use QVectors for filter and format arguments. (#430)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Fri, 6 Dec 2019 17:31:44 +0000 (10:31 -0700)
committerGitHub <noreply@github.com>
Fri, 6 Dec 2019 17:31:44 +0000 (10:31 -0700)
* use QVectors for filter and format arguments.

This includes a work around MSVC 2015 errors C2440, C2664.  See
the conditional code in defs.h.

* restore accidental deletion of include file.

118 files changed:
alan.cc
an1.cc
arcdist.h
bcr.cc
bend.h
brauniger_iq.cc
bushnell.cc
bushnell_trl.cc
compegps.cc
cst.cc
defs.h
destinator.cc
dg-100.cc
discard.h
dmtlog.cc
duplicate.h
easygps.cc
exif.cc
f90g_track.cc
filter.h
filter_vecs.cc
filterdefs.h
format_skeleton.cc
g7towin.cc
garmin.cc
garmin_fit.cc
garmin_gpi.cc
garmin_txt.cc
garmin_xt.cc
gdb.cc
geo.cc
geojson.cc
ggv_log.cc
ggv_ovl.cc
globalsat_sport.cc
glogbook.cc
gnav_trl.cc
gopal.cc
gpssim.cc
gpx.cc
gtm.cc
gtrnctr.cc
height.h
hiketech.cc
html.cc
humminbird.cc
igc.cc
ignrando.cc
igo8.cc
ik3d.cc
interpolate.h
itracku.cc
jogmap.cc
jtr.cc
kml.cc
lmx.cc
lowranceusr.cc
magproto.cc
mapasia.cc
mapbar_track.cc
mapfactor.cc
mapsend.cc
mapsource.cc
mmo.cc
mtk_locus.cc
mtk_logger.cc
navicache.cc
naviguide.cc
navilink.cc
netstumbler.cc
nmea.cc
nmn4.cc
nukedata.h
osm.cc
ozi.cc
pcx.cc
polygon.h
position.h
psitrex.cc
radius.h
random.cc
raymarine.cc
reverse_route.h
saroute.cc
sbn.cc
sbp.cc
shape.cc
skyforce.cc
skytraq.cc
smplrout.h
sort.h
stackfilter.h
stmsdf.cc
stmwpp.cc
subrip.cc
swapdata.h
tef_xml.cc
teletype.cc
text.cc
tiger.cc
tomtom.cc
tpg.cc
tpo.cc
trackfilter.cc
trackfilter.h
transform.h
unicsv.cc
validate.h
vcf.cc
vecs.cc
vidaone.cc
vpl.cc
wbt-200.cc
wfff_xml.cc
wintec_tes.cc
xcsv.cc
xol.cc
yahoo.cc

diff --git a/alan.cc b/alan.cc
index 0a88e60075424f8650d10347af1d6f199087d9b6..be5d7424922296da28b58785170b37d34d8842be 100644 (file)
--- a/alan.cc
+++ b/alan.cc
@@ -178,19 +178,17 @@ static gbfile* fin = nullptr, *fout = nullptr;
 static struct wprdata WPR;
 static struct trldata TRL;
 
-static arglist_t wpr_args[] = {
+static QVector<arglist_t> wpr_args = {
   /*
   {"os3", &osversion, "Operating system version 3",
           NULL, ARGTYPE_BOOL, ARGNOMINMAX },
   */
-  ARG_TERMINATOR
 };
-static arglist_t trl_args[] = {
+static QVector<arglist_t> trl_args = {
   /*
   {"os3", &osversion, "Operating system version 3",
           NULL, ARGTYPE_BOOL, ARGNOMINMAX },
   */
-  ARG_TERMINATOR
 };
 
 /**************************************************************************/
@@ -956,7 +954,7 @@ ff_vecs_t alanwpr_vecs = {
   wpr_read,
   wpr_write,
   alan_exit,
-  wpr_args,
+  &wpr_args,
   CET_CHARSET_ASCII, 0, /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   NULL_POS_OPS,
@@ -977,7 +975,7 @@ ff_vecs_t alantrl_vecs = {
   trl_read,
   trl_write,
   alan_exit,
-  trl_args,
+  &trl_args,
   CET_CHARSET_ASCII, 0, /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   NULL_POS_OPS,
diff --git a/an1.cc b/an1.cc
index 1d4543cf48adad57baec9a0ee508f0a9bfb79efd..20c9f76091387a74b32129faf4f3fac4453c9972 100644 (file)
--- a/an1.cc
+++ b/an1.cc
@@ -56,7 +56,7 @@ struct roadchange {
 static roadchange* roadchanges = nullptr;
 
 static
-arglist_t an1_args[] = {
+QVector<arglist_t> an1_args = {
   {
     "type", &output_type, "Type of .an1 file",
     "", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
@@ -94,7 +94,6 @@ arglist_t an1_args[] = {
     "radius", &opt_radius, "Radius for circles",
     nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 struct guid_t {
@@ -1213,7 +1212,7 @@ ff_vecs_t an1_vecs = {
   my_read,
   my_write,
   nullptr,
-  an1_args,
+  &an1_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index b818cfb1fe51bef0e04d55f984daaaa738fe773d..0c158b78c949c90ec937856cc0cdc6092350008e 100644 (file)
--- a/arcdist.h
+++ b/arcdist.h
@@ -30,9 +30,9 @@
 class ArcDistanceFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -54,7 +54,7 @@ private:
     Waypoint* arcpt1, * arcpt2;
   };
 
-  arglist_t args[8] = {
+  QVector<arglist_t> args = {
     {
       "file", &arcfileopt,  "File containing vertices of arc",
       nullptr, ARGTYPE_FILE, ARG_NOMINMAX, nullptr
@@ -83,7 +83,6 @@ private:
       "project", &projectopt, "Move waypoints to its projection on lines or vertices",
       nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   void arcdist_arc_disp_wpt_cb(const Waypoint* arcpt2);
diff --git a/bcr.cc b/bcr.cc
index d9ebe859d1d909654cce4a95fae5e7e134d9099a..f82204aeb5d75d975dea1b96974654f7a3541a6c 100644 (file)
--- a/bcr.cc
+++ b/bcr.cc
@@ -68,7 +68,7 @@ static char* radius_opt;
 static char* prefer_shortnames_opt;
 
 static
-arglist_t bcr_args[] = {
+QVector<arglist_t> bcr_args = {
   {
     "index", &rtenum_opt, "Index of route to write (if more than one in source)",
     nullptr, ARGTYPE_INT, "1", nullptr, nullptr
@@ -85,7 +85,6 @@ arglist_t bcr_args[] = {
     "prefer_shortnames", &prefer_shortnames_opt, "Use shortname instead of description",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 struct bcr_icon_mapping_t {
@@ -487,7 +486,7 @@ ff_vecs_t bcr_vecs = {
   bcr_data_read,
   bcr_data_write,
   nullptr,
-  bcr_args,
+  &bcr_args,
   CET_CHARSET_MS_ANSI, 0,      /* CET-REVIEW */
   NULL_POS_OPS,
   nullptr
diff --git a/bend.h b/bend.h
index 3fd2e9c2ba9fe047f4a5fe0e5dc7962f34eec007..6e6f4977aa3974932d6f72afaf4b105a985c631f 100644 (file)
--- a/bend.h
+++ b/bend.h
@@ -31,9 +31,9 @@
 class BendFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -48,7 +48,7 @@ private:
 
   RouteList* routes_orig = nullptr;
 
-  arglist_t args[3] = {
+  QVector<arglist_t> args = {
     {
       "distance", &distopt, "Distance to the bend in meters where the new points will be added",
       "25", ARGTYPE_FLOAT, ARG_NOMINMAX, nullptr
@@ -57,7 +57,6 @@ private:
       "minangle", &minangleopt, "Minimum bend angle in degrees", "5",
       ARGTYPE_FLOAT, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   Waypoint* create_wpt_dest(const Waypoint* wpt_orig, double lat_orig,
index 74786dc065e3e9513c14c108f3cd67de59e814ab..345dfa4352696e347dd7a46fb2ddbf15d66cabb7 100644 (file)
@@ -263,8 +263,7 @@ static void data_read()
   }
 }
 
-static arglist_t brauniger_iq_args[] = {
-  ARG_TERMINATOR
+static QVector<arglist_t> brauniger_iq_args = {
 };
 
 ff_vecs_t brauniger_iq_vecs = {
@@ -277,7 +276,7 @@ ff_vecs_t brauniger_iq_vecs = {
   data_read,
   nullptr,
   nullptr,
-  brauniger_iq_args,
+  &brauniger_iq_args,
   CET_CHARSET_UTF8, 1          /* master process: don't convert anything | CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 7e8a842da1cb86b152a31a899d955309ea4fc880..3cbec890d4cfa9fb9f2fd2f5e1fc896bca6dc2bc 100644 (file)
@@ -30,8 +30,7 @@ static QString ofname;
 static short_handle mkshort_handle = nullptr;
 
 static
-arglist_t bushnell_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> bushnell_args = {
 };
 
 // Apparently, the icons are undocumented, so we made up names,
@@ -260,7 +259,7 @@ ff_vecs_t bushnell_vecs = {
   bushnell_read,
   bushnell_write,
   nullptr,
-  bushnell_args,
+  &bushnell_args,
   CET_CHARSET_MS_ANSI, 0,  /* Not really sure... */
   NULL_POS_OPS,
   nullptr
index a237575336adbe654ba5bb94246ae7f378f9e4d4..a1cfef1e4e49f479500a6d57576446ad3ad59b92 100644 (file)
@@ -29,8 +29,7 @@ static int trkpt_count;
 static route_head* trk_head;
 
 static
-arglist_t bushnell_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> bushnell_args = {
 };
 
 static void
@@ -141,7 +140,7 @@ ff_vecs_t bushnell_trl_vecs = {
   bushnell_read,
   bushnell_write,
   nullptr,
-  bushnell_args,
+  &bushnell_args,
   CET_CHARSET_MS_ANSI, 0,  /* Not really sure... */
   NULL_POS_OPS,
   nullptr
index 101be2ce0de779d6fb80cd3ac02189211bdc647c..23700762798d31e883ee98501058edf754a39b52 100644 (file)
@@ -88,7 +88,7 @@ static char* option_radius;
 static char* option_snlen;
 
 static
-arglist_t compegps_args[] = {
+QVector<arglist_t> compegps_args = {
   {
     "deficon", &option_icon, "Default icon name",
     nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr
@@ -105,7 +105,6 @@ arglist_t compegps_args[] = {
     "snlen", &option_snlen, "Length of generated shortnames (default 16)",
     "16", ARGTYPE_INT, "1", nullptr, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static
@@ -691,7 +690,7 @@ ff_vecs_t compegps_vecs = {
   compegps_data_read,
   compegps_data_write,
   nullptr,
-  compegps_args,
+  &compegps_args,
   CET_CHARSET_MS_ANSI, 1
   , NULL_POS_OPS,
   nullptr
diff --git a/cst.cc b/cst.cc
index 8e64e1acbe64b9cce8177665c703d4bcae8930ed..887465bba37179df13e71585a889d5565794167f 100644 (file)
--- a/cst.cc
+++ b/cst.cc
@@ -43,8 +43,7 @@ static route_head* temp_route;
 /* placeholders for options */
 
 static
-arglist_t cst_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> cst_args = {
 };
 
 /* helpers */
@@ -324,7 +323,7 @@ ff_vecs_t cst_vecs = {
   cst_data_read,
   nullptr,             /* cst_data_write, */
   nullptr,
-  cst_args,
+  &cst_args,
   CET_CHARSET_MS_ANSI, 0       /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
diff --git a/defs.h b/defs.h
index de803ab932f394af0d30d5d599071d0040b539c6..e44d4ed41e75fdeb34319ac8b4202aae5c23f077 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -984,14 +984,18 @@ void setshort_is_utf8(short_handle h, int is_utf8);
 #define ARGTYPE_FLAGMASK 0xfffff000U
 
 #define ARG_NOMINMAX nullptr, nullptr
-#define ARG_TERMINATOR {nullptr, nullptr, nullptr, nullptr, 0, ARG_NOMINMAX, nullptr}
 
 struct arglist_t {
   const char* argstring;
   char** argval;
   const char* helpstring;
   const char* defaultvalue;
-  const uint32_t argtype;
+#if !defined(_MSC_VER) || (_MSC_VER >= 1910) /* !MSVC or MSVC 2017 or newer */
+  const uint32_t argtype{ARGTYPE_UNKNOWN};
+#else
+  /* MSVC 2015 generates C2440, C2664 errors with the above. */
+  uint32_t argtype;
+#endif
   const char* minvalue;                /* minimum value for numeric options */
   const char* maxvalue;                /* maximum value for numeric options */
   char* argvalptr;     /* !!! internal helper. Not used in definitions !!! */
@@ -1049,7 +1053,7 @@ struct ff_vecs_t {
   ff_read read;
   ff_write write;
   ff_exit exit;
-  arglist_t* args;
+  QVector<arglist_t>* args;
   QString encode;
   int fixed_encode;
   position_ops_t position_ops;
@@ -1069,11 +1073,11 @@ void debug_print(int level, const char* fmt, ...) PRINTFLIKE(2,3);
 
 ff_vecs_t* find_vec(const QString&);
 void assign_option(const QString& vecname, arglist_t* arg, const char* val);
-void disp_vec_options(const QString& vecname, const arglist_t* args);
+void disp_vec_options(const QString& vecname, const QVector<arglist_t>* args);
 void disp_vecs();
 void disp_vec(const QString& vecname);
-void validate_options(const QStringList& options, const arglist_t* args, const QString& name);
-bool validate_args(const QString& name, const arglist_t* args);
+void validate_options(const QStringList& options, const QVector<arglist_t>* args, const QString& name);
+bool validate_args(const QString& name, const QVector<arglist_t>* args);
 bool validate_formats();
 void init_vecs();
 void exit_vecs();
index 330d80613726d399ba07d03d85f0bbf66367d8d1..4ec15f11200604d29110e4ec967762152e7f51a7 100644 (file)
@@ -34,8 +34,7 @@
 #define DST_ITINERARY  "City->Street"
 
 static
-arglist_t destinator_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> destinator_args = {
 };
 
 static gbfile* fin, *fout;
@@ -545,7 +544,7 @@ ff_vecs_t destinator_poi_vecs = {
   destinator_read_poi_wrapper,
   destinator_write_poi,
   nullptr,
-  destinator_args,
+  &destinator_args,
   CET_CHARSET_UTF8, 1                  /* fixed */
   , NULL_POS_OPS,
   nullptr};
@@ -564,7 +563,7 @@ ff_vecs_t destinator_itn_vecs = {
   destinator_read_rte_wrapper,
   destinator_write_rte,
   nullptr,
-  destinator_args,
+  &destinator_args,
   CET_CHARSET_UTF8, 1                  /* fixed */
   , NULL_POS_OPS,
   nullptr};
@@ -583,7 +582,7 @@ ff_vecs_t destinator_trl_vecs = {
   destinator_read_trk_wrapper,
   destinator_write_trk,
   nullptr,
-  destinator_args,
+  &destinator_args,
   CET_CHARSET_UTF8, 1                  /* fixed */
   , NULL_POS_OPS,
   nullptr };
index 79748ad160c1423bc21570e58cad8a8818de988a..183b66c79976482e899052853a4603811177007c 100644 (file)
--- a/dg-100.cc
+++ b/dg-100.cc
@@ -659,7 +659,7 @@ static char* erase;
 static char* erase_only;
 
 static
-arglist_t dg100_args[] = {
+QVector<arglist_t> dg100_args = {
   {
     "erase", &erase, "Erase device data after download",
     "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -668,7 +668,6 @@ arglist_t dg100_args[] = {
     "erase_only", &erase_only, "Only erase device data, do not download anything",
     "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 /*******************************************************************************
@@ -743,7 +742,7 @@ ff_vecs_t dg100_vecs = {
   dg100_read,
   nullptr,
   nullptr,
-  dg100_args,
+  &dg100_args,
   CET_CHARSET_ASCII, 0                 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
@@ -764,7 +763,7 @@ ff_vecs_t dg200_vecs = {
   dg100_read,
   nullptr,
   nullptr,
-  dg100_args,
+  &dg100_args,
   CET_CHARSET_ASCII, 0                 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
index fca5a87cebf5c1e82f62ee2180491f51871bfcfe..155731d50aecad47a1ab49ab541b4086b7a1668a 100644 (file)
--- a/discard.h
+++ b/discard.h
@@ -31,9 +31,9 @@
 class DiscardFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -64,7 +64,7 @@ private:
   gpsdata_type what;
   route_head* head;
 
-  arglist_t args[13] = {
+  QVector<arglist_t> args = {
     {
       "hdop", &hdopopt, "Suppress points with higher hdop",
       "-1.0", ARGTYPE_BEGIN_REQ | ARGTYPE_FLOAT, ARG_NOMINMAX, nullptr
@@ -117,7 +117,6 @@ private:
       "Suppress points where type matches given name", nullptr, ARGTYPE_STRING,
       ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   void fix_process_wpt(const Waypoint* wpt);
index 7bc2a9e08547432a13dcd2da2687245d565f0aca..1514bf9a5c539ede6e0f15f5e471ef9b4c7f63cb 100644 (file)
--- a/dmtlog.cc
+++ b/dmtlog.cc
@@ -60,12 +60,11 @@ static char* opt_index;
 static int track_index, this_index;
 
 static
-arglist_t dmtlog_args[] = {
+QVector<arglist_t> dmtlog_args = {
   {
     "index", &opt_index,
     "Index of track (if more than one in source)", "1", ARGTYPE_INT, "1", nullptr, nullptr
   },
-  ARG_TERMINATOR
 };
 
 
@@ -836,7 +835,7 @@ ff_vecs_t dmtlog_vecs = {
   dmtlog_read,
   dmtlog_write,
   nullptr,
-  dmtlog_args,
+  &dmtlog_args,
   CET_CHARSET_ASCII, 0
   , NULL_POS_OPS,
   nullptr
index 9ffa19bb9e8ddebbaeb8302170c299ccffa7af59..e34607f3fd432187502abb721291b1eb4e052651 100644 (file)
@@ -30,9 +30,9 @@
 class DuplicateFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void process() override;
 
@@ -42,7 +42,7 @@ private:
   char* purge_duplicates = nullptr;
   char* correct_coords = nullptr;
 
-  arglist_t args[5] = {
+  QVector<arglist_t> args = {
     {
       "shortname", &snopt, "Suppress duplicate waypoints based on name",
       nullptr, ARGTYPE_BEGIN_REQ | ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -59,7 +59,6 @@ private:
       "correct", &correct_coords, "Use coords from duplicate points",
       nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   struct btree_node {
index c6ff725c54b619406c63dc944eb53c41a08fab19..af401bfed78a81c8133b5807181f0a2f78d87f48 100644 (file)
@@ -30,10 +30,9 @@ static short_handle mkshort_handle;
 #define MYNAME "EasyGPS"
 
 static
-arglist_t easygps_args[] = {
+QVector<arglist_t> easygps_args = {
   /*   {"deficon", &deficon, "Default icon name", "Waypoint",
        ARGTYPE_STRING}, */
-  ARG_TERMINATOR
 };
 
 static void
@@ -217,7 +216,7 @@ ff_vecs_t easygps_vecs = {
   data_read,
   data_write,
   nullptr,
-  easygps_args,
+  &easygps_args,
   CET_CHARSET_ASCII, 0 /* CET REVIEW */
   , NULL_POS_OPS,
   nullptr
diff --git a/exif.cc b/exif.cc
index b76f75922bf74341434862c82195953f6becf1b6..e58ecbde1fce6beaddbb83138d67183f89391616 100644 (file)
--- a/exif.cc
+++ b/exif.cc
@@ -197,12 +197,11 @@ static char* opt_filename, *opt_overwrite, *opt_frame, *opt_name;
 
 static uint8_t writer_gps_tag_version[4] = {2, 0, 0, 0};
 
-static arglist_t exif_args[] = {
+static QVector<arglist_t> exif_args = {
   { "filename", &opt_filename, "Set waypoint name to source filename", "Y", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
   { "frame", &opt_frame, "Time-frame (in seconds)", "10", ARGTYPE_INT, "0", nullptr, nullptr },
   { "name", &opt_name, "Locate waypoint for tagging by this name", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
   { "overwrite", &opt_overwrite, "!OVERWRITE! the original file. Default=N", "N", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
-  ARG_TERMINATOR
 };
 
 // for debug only
@@ -1685,7 +1684,7 @@ ff_vecs_t exif_vecs = {
   exif_read,
   exif_write,
   nullptr,
-  exif_args,
+  &exif_args,
   CET_CHARSET_UTF8, 0,
   NULL_POS_OPS,
   nullptr
index 6983792920f5d4ef59aa293e455a56f58da0497f..47fe8ae5986a36dc173120d50d750d5f6c86a227 100644 (file)
@@ -42,8 +42,7 @@ static route_head* track = nullptr;
 
 
 static
-arglist_t f90g_track_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> f90g_track_args = {
 };
 
 /*******************************************************************************
@@ -151,7 +150,7 @@ ff_vecs_t f90g_track_vecs = {
   f90g_track_read,
   nullptr,
   nullptr,
-  f90g_track_args,
+  &f90g_track_args,
   CET_CHARSET_UTF8, 0                  /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
index a60037e6d8606bfe0d08c0aa227d8382b3248e28..6f8c3dc7d6a066915f2b96b8773d03f547183593 100644 (file)
--- a/filter.h
+++ b/filter.h
@@ -38,7 +38,7 @@ public:
   Filter(Filter&&) = default;
   Filter& operator=(Filter&&) = default;
 
-  virtual arglist_t* get_args() = 0;
+  virtual QVector<arglist_t>* get_args() = 0;
 
   virtual void init()
   {
index 7e19a0db0b110ec7095e816e7b6830f40bd57890..99ddfa2cc67f5bfd0efe4d8351c4834575de08e4 100644 (file)
@@ -51,6 +51,7 @@
 #include <QtCore/QtGlobal>     // for qPrintable
 
 #include <algorithm>           // for sort
+#include <cassert>             // for assert
 #include <cstdio>              // for printf
 
 
@@ -196,32 +197,34 @@ find_filter_vec(const QString& vecname)
       continue;
     }
 
-    arglist_t* args = vec.vec->get_args();
+    QVector<arglist_t>* args = vec.vec->get_args();
 
     validate_options(options, args, vec.name);
 
     /* step 1: initialize by inifile or default values */
-    if (args) {
-      for (auto arg = args; arg->argstring; arg++) {
-        QString qtemp = inifile_readstr(global_opts.inifile, vec.name, arg->argstring);
+    if (args && !args->isEmpty()) {
+      assert(args->isDetached());
+      for (auto& arg : *args) {
+        QString qtemp = inifile_readstr(global_opts.inifile, vec.name, arg.argstring);
         if (qtemp.isNull()) {
-          qtemp = inifile_readstr(global_opts.inifile, "Common filter settings", arg->argstring);
+          qtemp = inifile_readstr(global_opts.inifile, "Common filter settings", arg.argstring);
         }
         if (qtemp.isNull()) {
-          assign_option(vec.name, arg, arg->defaultvalue);
+          assign_option(vec.name, &arg, arg.defaultvalue);
         } else {
-          assign_option(vec.name, arg, CSTR(qtemp));
+          assign_option(vec.name, &arg, CSTR(qtemp));
         }
       }
     }
 
     /* step 2: override settings with command-line values */
     if (!options.isEmpty()) {
-      if (args) {
-        for (auto arg = args; arg->argstring; arg++) {
-          const QString opt = get_option(options, arg->argstring);
+      if (args && !args->isEmpty()) {
+        assert(args->isDetached());
+        for (auto& arg : *args) {
+          const QString opt = get_option(options, arg.argstring);
           if (!opt.isNull()) {
-            assign_option(vec.name, arg, CSTR(opt));
+            assign_option(vec.name, &arg, CSTR(opt));
           }
         }
       }
@@ -240,13 +243,14 @@ find_filter_vec(const QString& vecname)
 void
 free_filter_vec(Filter* filter)
 {
-  arglist_t* args = filter->get_args();
-
-  if (args) {
-    for (auto arg = args; arg->argstring; arg++) {
-      if (arg->argvalptr) {
-        xfree(arg->argvalptr);
-        arg->argvalptr = *arg->argval = nullptr;
+  QVector<arglist_t>* args = filter->get_args();
+
+  if (args && !args->isEmpty()) {
+    assert(args->isDetached());
+    for (auto& arg : *args) {
+      if (arg.argvalptr) {
+        xfree(arg.argvalptr);
+        arg.argvalptr = *arg.argval = nullptr;
       }
     }
   }
@@ -256,10 +260,11 @@ void
 init_filter_vecs()
 {
   for (const auto& vec : filter_vec_list) {
-    arglist_t* args = vec.vec->get_args();
-    if (args) {
-      for (auto arg = args; arg->argstring; arg++) {
-        arg->argvalptr = nullptr;
+    QVector<arglist_t>* args = vec.vec->get_args();
+    if (args && !args->isEmpty()) {
+      assert(args->isDetached());
+      for (auto& arg : *args) {
+        arg.argvalptr = nullptr;
       }
     }
   }
@@ -283,13 +288,13 @@ disp_filter_vecs()
   for (const auto& vec : filter_vec_list) {
     printf("   %-20.20s  %-50.50s\n",
            qPrintable(vec.name), qPrintable(vec.desc));
-    arglist_t* args = vec.vec->get_args();
+    const QVector<arglist_t>* args = vec.vec->get_args();
     if (args) {
-      for (auto arg = args; arg->argstring; arg++) {
-        if (!(arg->argtype & ARGTYPE_HIDDEN))
+      for (const auto& arg : *args) {
+        if (!(arg.argtype & ARGTYPE_HIDDEN))
           printf("       %-18.18s    %-.50s %s\n",
-                 arg->argstring, arg->helpstring,
-                 (arg->argtype & ARGTYPE_REQUIRED) ? "(required)" : "");
+                 arg.argstring, arg.helpstring,
+                 (arg.argtype & ARGTYPE_REQUIRED) ? "(required)" : "");
       }
     }
   }
@@ -304,13 +309,13 @@ disp_filter_vec(const QString& vecname)
     }
     printf("   %-20.20s  %-50.50s\n",
            qPrintable(vec.name), qPrintable(vec.desc));
-    arglist_t* args = vec.vec->get_args();
+    const QVector<arglist_t>* args = vec.vec->get_args();
     if (args) {
-      for (auto arg = args; arg->argstring; arg++) {
-        if (!(arg->argtype & ARGTYPE_HIDDEN))
+      for (const auto& arg : *args) {
+        if (!(arg.argtype & ARGTYPE_HIDDEN))
           printf("       %-18.18s    %-.50s %s\n",
-                 arg->argstring, arg->helpstring,
-                 (arg->argtype & ARGTYPE_REQUIRED) ? "(required)" : "");
+                 arg.argstring, arg.helpstring,
+                 (arg.argtype & ARGTYPE_REQUIRED) ? "(required)" : "");
       }
     }
   }
@@ -330,19 +335,19 @@ disp_v1(const fl_vecs_t& vec)
 {
   disp_help_url(vec, nullptr);
   printf("\n");
-  arglist_t* args = vec.vec->get_args();
+  const QVector<arglist_t>* args = vec.vec->get_args();
   if (args) {
-    for (auto arg = args; arg->argstring; arg++) {
-      if (!(arg->argtype & ARGTYPE_HIDDEN)) {
+    for (const auto& arg : *args) {
+      if (!(arg.argtype & ARGTYPE_HIDDEN)) {
         printf("option\t%s\t%s\t%s\t%s\t%s\t%s\t%s",
                CSTR(vec.name),
-               arg->argstring,
-               arg->helpstring,
-               name_option(arg->argtype),
-               arg->defaultvalue ? arg->defaultvalue : "",
-               arg->minvalue ? arg->minvalue : "",
-               arg->maxvalue ? arg->maxvalue : "");
-        disp_help_url(vec, arg);
+               arg.argstring,
+               arg.helpstring,
+               name_option(arg.argtype),
+               arg.defaultvalue ? arg.defaultvalue : "",
+               arg.minvalue ? arg.minvalue : "",
+               arg.maxvalue ? arg.maxvalue : "");
+        disp_help_url(vec, &arg);
         printf("\n");
       }
     }
index 49efa99c246da4bab68befbbae47cab207cae9f6..97b93ae8f9a4869297f6eb0213f3219b2e5530c7 100644 (file)
@@ -44,7 +44,7 @@ struct filter_vecs_t {
   filter_process f_process;
   filter_deinit f_deinit;
   filter_exit f_exit;
-  arglist_t* args;
+  QVector<arglist_t>* args;
 };
 
 Filter* find_filter_vec(const QString&);
index 8d203b994d3fe8bc814db800b0694d354460d3e2..1716fa5810e164b821b6952e7406f3d56740e8d0 100644 (file)
 // Values for ARGTYPE_xxx can be found in defs.h and are used to
 // select the type of option.
 static
-arglist_t format_skeleton_args[] = {
+QVector<arglist_t> format_skeleton_args = {
 // {"foo", &fooopt, "The text of the foo option in help",
 //   "default", ARGYTPE_STRING, ARG_NOMINMAX} ,
-  ARG_TERMINATOR
 };
 
 /*******************************************************************************
@@ -148,7 +147,7 @@ ff_vecs_t format_skeleton_vecs = {
   format_skeleton_read,
   format_skeleton_write,
   format_skeleton_exit,
-  format_skeleton_args,
+  &format_skeleton_args,
   CET_CHARSET_ASCII, 0,                        /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   NULL_POS_OPS, // Unless you do realtime positioning
index 1e575cb1ec2af1fc3c003b1719383561d40249b6..948a9518a9abc5230d13ddc8d0fbe315c8b6e3c1 100644 (file)
@@ -51,8 +51,7 @@ static int gardown;
 static int event_ct;
 
 static
-arglist_t g7towin_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> g7towin_args = {
 };
 
 #define WAYPT__OFS     0x00000
@@ -583,7 +582,7 @@ ff_vecs_t g7towin_vecs = {
   data_read,
   nullptr,
   nullptr,
-  g7towin_args,
+  &g7towin_args,
   CET_CHARSET_MS_ANSI, 0
   , NULL_POS_OPS,
   nullptr
index 09adc9c8de11b9d342a62cdc7e4edca890d6ce73..0b94f79a313b820bf6ffb3031dbb7fcd10ad18e3 100644 (file)
--- a/garmin.cc
+++ b/garmin.cc
@@ -75,7 +75,7 @@ static ff_vecs_t* gpx_vec;
 static const char* valid_waypt_chars = MILITANT_VALID_WAYPT_CHARS " ";
 
 static
-arglist_t garmin_args[] = {
+QVector<arglist_t> garmin_args = {
   {
     "snlen", &snlen, "Length of generated shortnames", nullptr,
     ARGTYPE_INT, "1", nullptr, nullptr
@@ -113,7 +113,6 @@ arglist_t garmin_args[] = {
     "baud", &baudopt, "Speed in bits per second of serial port (baud=9600)",
     nullptr, ARGTYPE_INT, ARG_NOMINMAX, nullptr },
 
-  ARG_TERMINATOR
 };
 
 static const char* d103_symbol_from_icon_number(unsigned int n);
@@ -1252,7 +1251,7 @@ ff_vecs_t garmin_vecs = {
   data_read,
   data_write,
   nullptr,
-  garmin_args,
+  &garmin_args,
   CET_CHARSET_ASCII, 0,
   { pvt_init, pvt_read, rw_deinit, nullptr, nullptr, nullptr },
   nullptr
index dc5f30c1df4f5934e950657756bc7bded71e9ab9..357484b767be199a168263c9bf74d2fb09d16535 100644 (file)
@@ -138,13 +138,12 @@ static bool write_header_msgs = false;
 
 
 static
-arglist_t fit_args[] = {
+QVector<arglist_t> fit_args = {
   {
     "allpoints", &opt_allpoints,
     "Read all points even if latitude or longitude is missing",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 const std::vector<std::pair<QString, int> > kCoursePointTypeMapping = {
@@ -1382,7 +1381,7 @@ ff_vecs_t format_fit_vecs = {
   fit_read,
   fit_write,
   nullptr,
-  fit_args,
+  &fit_args,
   CET_CHARSET_ASCII, 0         /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
index 395679c7f9575447b586e9655037668c388fee03..12570742a611763a4b13118f9383cbc781d3ffe1 100644 (file)
@@ -88,7 +88,7 @@ static char* opt_writecodec;
 static double defspeed, defproximity;
 static int alerts;
 
-static arglist_t garmin_gpi_args[] = {
+static QVector<arglist_t> garmin_gpi_args = {
   {
     "alerts", &opt_alerts, "Enable alerts on speed or proximity distance",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -145,7 +145,6 @@ static arglist_t garmin_gpi_args[] = {
     "languagecode", &opt_lang, "language code to use for reading dual language files",
     nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 struct reader_data_t {
@@ -1636,7 +1635,7 @@ ff_vecs_t garmin_gpi_vecs = {
   garmin_gpi_read,
   garmin_gpi_write,
   nullptr,
-  garmin_gpi_args,
+  &garmin_gpi_args,
   CET_CHARSET_MS_ANSI, 0               /* WIN-CP1252 */
   , NULL_POS_OPS,
   nullptr
index 8f48a26103f982c301b2dff514473978985b0236..440368cf4b167714a3435972513f63bad10695a9 100644 (file)
@@ -124,7 +124,7 @@ static char* opt_utc = nullptr;
 static char* opt_grid = nullptr;
 
 static
-arglist_t garmin_txt_args[] = {
+QVector<arglist_t> garmin_txt_args = {
   {"date",  &opt_date_format, "Read/Write date format (i.e. yyyy/mm/dd)", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
   {"datum", &opt_datum,            "GPS datum (def. WGS 84)", "WGS 84", ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
   {"dist",  &opt_dist,        "Distance unit [m=metric, s=statute]", "m", ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
@@ -133,7 +133,6 @@ arglist_t garmin_txt_args[] = {
   {"temp",  &opt_temp,        "Temperature unit [c=Celsius, f=Fahrenheit]", "c", ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
   {"time",  &opt_time_format, "Read/Write time format (i.e. HH:mm:ss xx)", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
   {"utc",   &opt_utc,         "Write timestamps with offset x to UTC time", nullptr, ARGTYPE_INT, "-23", "+23", nullptr},
-  ARG_TERMINATOR
 };
 
 struct info_t {
@@ -1395,7 +1394,7 @@ ff_vecs_t garmin_txt_vecs = {
   garmin_txt_read,
   garmin_txt_write,
   nullptr,
-  garmin_txt_args,
+  &garmin_txt_args,
   CET_CHARSET_MS_ANSI, 0
   , NULL_POS_OPS,
   nullptr
index 2b6a8eede0c7507bbd4601117234057df9570953..fcd629813563ab443bc4880b3d482f9e7addf23b 100644 (file)
@@ -56,12 +56,11 @@ static char*        opt_xt_ftype = nullptr;
 static char*   opt_trk_header = nullptr;
 
 static
-arglist_t format_garmin_xt_args[] = {
+QVector<arglist_t> format_garmin_xt_args = {
   {"ftype", &opt_xt_ftype, "Garmin Mobile XT ([ATRK]/STRK)", "ATRK", ARGTYPE_STRING | ARGTYPE_REQUIRED, ARG_NOMINMAX, nullptr},
   // TODO: SHIFT - can't test behaviour, do not have appropriate files
   //{"trk_header_opt", &opt_trk_header, "Track name processing option ([0]-nrm/1-ign/2-sht)", "0", ARGTYPE_INT, ARG_NOMINMAX},
   {"trk_header", &opt_trk_header, "Track name processing option ([0]-nrm/1-ign)", "0", ARGTYPE_INT, ARG_NOMINMAX, nullptr},
-  ARG_TERMINATOR
 };
 
 /*******************************************************************************
@@ -412,7 +411,7 @@ ff_vecs_t format_garmin_xt_vecs = {
   format_garmin_xt_read,
   nullptr,
   nullptr,
-  format_garmin_xt_args,
+  &format_garmin_xt_args,
   CET_CHARSET_ASCII, 0                 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
diff --git a/gdb.cc b/gdb.cc
index 8bf71d1c8b4741c50446c9d086a066105cfe10cf..76ca0c74f2e34ce7d2ed0aef303af077f9fb8aae 100644 (file)
--- a/gdb.cc
+++ b/gdb.cc
@@ -1808,7 +1808,7 @@ write_data()
 #define GDB_OPT_BITCATEGORY    "bitscategory"
 #define GDB_OPT_ROADBOOK       "roadbook"
 
-static arglist_t gdb_args[] = {
+static QVector<arglist_t> gdb_args = {
   {
     GDB_OPT_CATEGORY, &gdb_opt_category,
     "Default category on output (1..16)",
@@ -1834,7 +1834,6 @@ static arglist_t gdb_args[] = {
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
 
-  ARG_TERMINATOR
 };
 
 ff_vecs_t gdb_vecs = {
@@ -1847,7 +1846,7 @@ ff_vecs_t gdb_vecs = {
   read_data,
   write_data,
   nullptr,
-  gdb_args,
+  &gdb_args,
   CET_CHARSET_MS_ANSI, 0       /* O.K.: changed to NON-FIXED */
   /* because of utf8 strings since GDB V3 */
   , NULL_POS_OPS,
diff --git a/geo.cc b/geo.cc
index df83101568b3f5cacd5482230064e7a92b72ac41..8fbcc84cb1ec6d3aae14a32aa52d270a8bdad0e1 100644 (file)
--- a/geo.cc
+++ b/geo.cc
@@ -29,10 +29,9 @@ static QString ostring;
 static QXmlStreamWriter writer(&ostring);
 
 static
-arglist_t geo_args[] = {
+QVector<arglist_t> geo_args = {
   {"deficon", &deficon, "Default icon name", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
   {"nuke_placer", &nuke_placer, "Omit Placer name", nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
-  ARG_TERMINATOR
 };
 
 #define MYNAME "geo"
@@ -266,7 +265,7 @@ ff_vecs_t geo_vecs = {
   geo_read,
   geo_write,
   nullptr,
-  geo_args,
+  &geo_args,
   CET_CHARSET_UTF8, 0, /* CET-REVIEW */
   NULL_POS_OPS,
   nullptr
index 751701aa3238beea2ca7995cf7d16c451434fdbe..2ea354e416fc184d5063bf0fda30d54a66c19808 100644 (file)
@@ -47,10 +47,9 @@ static const QString DESCRIPTION = QStringLiteral("description");
 static const QString URL = QStringLiteral("url");
 static const QString URLNAME = QStringLiteral("urlname");
 
-static arglist_t geojson_args[] = {
+static QVector<arglist_t> geojson_args = {
   {"compact", &compact_opt, "Compact Output. Default is off.", 
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr } ,
-  ARG_TERMINATOR
 };
 
 static void
@@ -324,7 +323,7 @@ ff_vecs_t geojson_vecs = {
   geojson_read,
   geojson_write,
   nullptr,
-  geojson_args,
+  &geojson_args,
   CET_CHARSET_UTF8, 0  /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr  
index e589dff58d2d7196f40c8e8b65563ea51d0d67e5..2d15b16c340af835783d07bc75b1476ad15e952f 100644 (file)
@@ -43,8 +43,7 @@ static gbfile* fin, *fout;
 static int ggv_log_ver;
 
 static
-arglist_t ggv_log_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> ggv_log_args = {
 };
 
 /*******************************************************************************
@@ -280,7 +279,7 @@ ff_vecs_t ggv_log_vecs = {
   ggv_log_read,
   ggv_log_write,
   nullptr,
-  ggv_log_args,
+  &ggv_log_args,
   CET_CHARSET_ASCII, 1
   , NULL_POS_OPS,
   nullptr
index 3c326b7f1f29d62e0ae53cff36f3487427913372..4ba62397344e58b834fba6bcddaea4225e62d463 100644 (file)
@@ -35,8 +35,7 @@
 #define MYNAME "ggv_ovl"
 
 static
-arglist_t ggv_ovl_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> ggv_ovl_args = {
 };
 
 enum OVL_SYMBOL_TYP {
@@ -445,7 +444,7 @@ ff_vecs_t ggv_ovl_vecs = {
   ggv_ovl_read,
   ggv_ovl_write,
   nullptr,
-  ggv_ovl_args,
+  &ggv_ovl_args,
   CET_CHARSET_MS_ANSI, 0
   , NULL_POS_OPS,
   nullptr
index 2d801a2fff759106313d0e3994dbbc58d6c4518e..f40aa00885df09fcb6debdd0f049f7a4c3db1ba2 100644 (file)
@@ -56,12 +56,11 @@ static gbfile* dumpfile = nullptr;             // used for creating bin/RAW data
 static gbfile* in_file = nullptr;              // used for reading from bin/RAW datadump files, useful for testing
 
 static
-arglist_t globalsat_args[] = {
+QVector<arglist_t> globalsat_args = {
   {"showlist", &showlist, "list tracks", nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr},
   {"track", &track, "get track", "0", ARGTYPE_INT, ARG_NOMINMAX, nullptr},
   {"dump-file", &opt_dump_file, "Dump raw data to this file", nullptr, ARGTYPE_OUTFILE, ARG_NOMINMAX, nullptr},
   {"input-is-dump-file", &opt_input_dump_file, "Dump raw data to this file", nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr},
-  ARG_TERMINATOR
 };
 
 enum globalsat_commands_e {
@@ -823,7 +822,7 @@ ff_vecs_t globalsat_sport_vecs = {
   data_read,                                   // read
   nullptr,                                             // write
   nullptr,                                             // exit
-  globalsat_args,                      // args
+  &globalsat_args,                     // args
   CET_CHARSET_ASCII,   // encode
   0,                                                                   // fixed_encode
   NULL_POS_OPS,                                // position_ops
index ca768a69a7d7523ba51efbfb2ff6822d04487487..27fe70f59ae116afb191e5f5c026a6fe6da50ad8 100644 (file)
@@ -36,8 +36,7 @@ static route_head* trk_head;
 #define MYNAME "glogbook"
 
 static
-arglist_t glogbook_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> glogbook_args = {
 };
 
 /* Tracks */
@@ -187,7 +186,7 @@ ff_vecs_t glogbook_vecs = {
   glogbook_read,
   glogbook_write,
   nullptr,
-  glogbook_args,
+  &glogbook_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index b8872d4d629da24cb1066b34fd3fe7c309ecf758..425ae3c4746e4cbbaa273a1a86102209046c272c 100644 (file)
@@ -25,8 +25,7 @@
 #define MYNAME "gnav_trl"
 
 static
-arglist_t gnav_trl_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> gnav_trl_args = {
 };
 
 struct gnav_trl_t {
@@ -151,7 +150,7 @@ ff_vecs_t gnav_trl_vecs = {
   gnav_trl_read,
   gnav_trl_write,
   nullptr,
-  gnav_trl_args,
+  &gnav_trl_args,
   CET_CHARSET_UTF8, 1  /* CET - do nothing ! */
   , NULL_POS_OPS,
   nullptr
index 1734a492583917ab630b06b47a43d795c207f7a2..78cb821f0c65ed5cf3bebaa642e0973b72876ebf 100644 (file)
--- a/gopal.cc
+++ b/gopal.cc
@@ -73,12 +73,11 @@ static char* optclean= nullptr;
 static double minspeed,maxspeed;
 static struct tm opt_tm;       /* converted "date" parameter */
 static
-arglist_t gopal_args[] = {
+QVector<arglist_t> gopal_args = {
   {"date", &optdate, "Complete date-free tracks with given date (YYYYMMDD).", nullptr, ARGTYPE_INT, ARG_NOMINMAX, nullptr },
   {"maxspeed", &optmaxspeed, "The maximum speed (km/h) traveling from waypoint to waypoint.", "200", ARGTYPE_INT, "1", "1000", nullptr },
   {"minspeed", &optminspeed, "The minimum speed (km/h) traveling from waypoint to waypoint. Set >0 to remove duplicate waypoints", "0", ARGTYPE_INT, "0", "999", nullptr },
   {"clean", &optclean, "Cleanup common errors in trackdata", "1", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
-  ARG_TERMINATOR
 };
 
 #define CHECK_BOOL(a) if (a && (*a == '0')) a = NULL
@@ -414,7 +413,7 @@ ff_vecs_t gopal_vecs = {
   gopal_read,
   gopal_write,
   gopal_exit,
-  gopal_args,
+  &gopal_args,
   CET_CHARSET_ASCII, 0 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
index c20affc2decc3cfd8454cb3be7db452b7e63ec15..01e33175a39a772d6229470476b43fdc978dcbc1 100644 (file)
--- a/gpssim.cc
+++ b/gpssim.cc
@@ -36,7 +36,7 @@ static int trk_count;
 static int doing_tracks;
 
 static
-arglist_t gpssim_args[] = {
+QVector<arglist_t> gpssim_args = {
   {
     "wayptspd", &wayptspd, "Default speed for waypoints (knots/hr)",
     nullptr, ARGTYPE_FLOAT, ARG_NOMINMAX, nullptr
@@ -45,7 +45,6 @@ arglist_t gpssim_args[] = {
     "split", &splitfiles_opt, "Split input into separate files",
     "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 /*
@@ -198,7 +197,7 @@ ff_vecs_t gpssim_vecs = {
   nullptr,
   gpssim_write,
   nullptr,
-  gpssim_args,
+  &gpssim_args,
   CET_CHARSET_ASCII, 0
   , NULL_POS_OPS,
   nullptr
diff --git a/gpx.cc b/gpx.cc
index 337c149a35c220cb266a10e5f0edeedfb5811b6d..ab20dfe23515f669bbc1e8e79fd420708711eff1 100644 (file)
--- a/gpx.cc
+++ b/gpx.cc
@@ -2014,7 +2014,7 @@ gpx_exit()
 }
 
 static
-arglist_t gpx_args[] = {
+QVector<arglist_t> gpx_args = {
   {
     "snlen", &snlen, "Length of generated shortnames",
     "32", ARGTYPE_INT, "1", nullptr, nullptr
@@ -2052,7 +2052,6 @@ arglist_t gpx_args[] = {
     "Precision of elevations, number of decimals",
     "3", ARGTYPE_INT, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 ff_vecs_t gpx_vecs = {
@@ -2065,7 +2064,7 @@ ff_vecs_t gpx_vecs = {
   gpx_read,
   gpx_write,
   gpx_exit,
-  gpx_args,
+  &gpx_args,
   CET_CHARSET_UTF8, 0, /* non-fixed to create non UTF-8 XML's for testing | CET-REVIEW */
   NULL_POS_OPS,
   nullptr,
diff --git a/gtm.cc b/gtm.cc
index 359de8303597bc2dba2ac3a41388945c63fd6c55..f417fd630659b84338c15828d070a1b1bd863f4c 100644 (file)
--- a/gtm.cc
+++ b/gtm.cc
@@ -732,8 +732,7 @@ gtm_write()
 }
 
 static
-arglist_t gtm_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> gtm_args = {
 };
 
 ff_vecs_t gtm_vecs = {
@@ -746,7 +745,7 @@ ff_vecs_t gtm_vecs = {
   gtm_read,
   gtm_write,
   nullptr,
-  gtm_args,
+  &gtm_args,
   CET_CHARSET_ASCII, 0, /* CET-REVIEW */
   NULL_POS_OPS,
   nullptr
index d8fd49fc26756ea3a9c3d89ad3d3d201559be2c7..4e1e1ea96db17b53c140409ca1f89bb1d07634af 100644 (file)
@@ -55,7 +55,7 @@ static double gtc_end_long;
 static char* opt_sport, *opt_course;
 
 static
-arglist_t gtc_args[] = {
+QVector<arglist_t> gtc_args = {
   {
     "course", &opt_course, "Write course rather than history, default yes",
     "1", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -64,7 +64,6 @@ arglist_t gtc_args[] = {
     "sport", &opt_sport, "Sport: Biking (deflt), Running, MultiSport, Other",
     "Biking", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 /* Tracks */
@@ -646,7 +645,7 @@ ff_vecs_t gtc_vecs = {
   gtc_read,
   gtc_write,
   nullptr,
-  gtc_args,
+  &gtc_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 94d03086c791810b88c42e19b7ed75ad68ca5ba0..8a472e8999516ce7eac1d3ad5562a48d0a38f440 100644 (file)
--- a/height.h
+++ b/height.h
@@ -32,9 +32,9 @@
 class HeightFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -44,7 +44,7 @@ private:
   char* wgs84tomslopt = nullptr;
   double addf;
 
-  arglist_t args[3] = {
+  QVector<arglist_t> args = {
     {
       "add", &addopt, "Adds a constant value to every altitude (meter, append \"f\" (x.xxf) for feet)",
       nullptr, ARGTYPE_BEGIN_REQ | ARGTYPE_FLOAT, ARG_NOMINMAX, nullptr
@@ -53,7 +53,6 @@ private:
       "wgs84tomsl", &wgs84tomslopt, "Converts WGS84 ellipsoidal height to orthometric height (MSL)",
       nullptr, ARGTYPE_END_REQ | ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   double bilinear(double x1, double y1, double x2, double y2, double x, double y, double z11, double z12, double z21, double z22);
index 645c40e4d28de55de7e1827b261d95b41d97e3c0..6b44e8514d1ddd142555963c4c863b4deef665d0 100644 (file)
@@ -35,8 +35,7 @@ static route_head* trk_head;
 #define MYNAME "hiketech"
 
 static
-arglist_t hiketech_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> hiketech_args = {
 };
 
 /* Waypoints */
@@ -312,7 +311,7 @@ ff_vecs_t hiketech_vecs = {
   hiketech_read,
   hiketech_write,
   nullptr,
-  hiketech_args,
+  &hiketech_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
diff --git a/html.cc b/html.cc
index 144180ee4935f69e7fc2a82f9956061995ddc324..a9e3f052cc28518c8a640c147016f0f135f7d1a2 100644 (file)
--- a/html.cc
+++ b/html.cc
@@ -38,7 +38,7 @@ static char* altunits = nullptr;
 #define MYNAME "HTML"
 
 static
-arglist_t html_args[] = {
+QVector<arglist_t> html_args = {
   {
     "stylesheet", &stylesheet,
     "Path to HTML style sheet", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr
@@ -59,7 +59,6 @@ arglist_t html_args[] = {
     "altunits", &altunits,
     "Units for altitude (f)eet or (m)etres", "m", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 
@@ -290,7 +289,7 @@ ff_vecs_t html_vecs = {
   nullptr,
   data_write,
   nullptr,
-  html_args,
+  &html_args,
   CET_CHARSET_UTF8, 0  /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index e1380f0270b0ab22cd09ae96e51fe8187d63b5c0..562049bd3b0eb23ba6ab08b544d2f0f710449be0 100644 (file)
@@ -198,8 +198,7 @@ static int rte_num;
 static QMap<QString, Waypoint*> map;
 
 static
-arglist_t humminbird_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> humminbird_args = {
 };
 
 /* Takes a latitude in degrees,
@@ -951,7 +950,7 @@ ff_vecs_t humminbird_vecs = {
   humminbird_read,
   humminbird_write,
   nullptr, // humminbird_exit,
-  humminbird_args,
+  &humminbird_args,
   CET_CHARSET_ASCII, 1                 /* ascii is the expected character set */
   /* currently fixed !!! */
   , NULL_POS_OPS,
@@ -976,7 +975,7 @@ ff_vecs_t humminbird_ht_vecs = {
   humminbird_read,
   humminbird_track_write,
   nullptr, // humminbird_exit,
-  humminbird_args,
+  &humminbird_args,
   CET_CHARSET_ASCII, 1                 /* ascii is the expected character set */
   /* currently fixed !!! */
   , NULL_POS_OPS,
diff --git a/igc.cc b/igc.cc
index 0cc5540e2bc9afef64d3fd2fb15c69bfb6ffcb84..47a0e480fc80a512039c621baa4e593ce764b9eb 100644 (file)
--- a/igc.cc
+++ b/igc.cc
@@ -938,13 +938,12 @@ static void data_write()
 }
 
 
-static arglist_t igc_args[] = {
+static QVector<arglist_t> igc_args = {
   {
     "timeadj", &timeadj,
     "(integer sec or 'auto') Barograph to GPS time diff",
     nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 ff_vecs_t igc_vecs = {
@@ -957,7 +956,7 @@ ff_vecs_t igc_vecs = {
   data_read,
   data_write,
   nullptr,
-  igc_args,
+  &igc_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 1e210883762f697cd50b67ea917238856d1df815..2851f23df6a823442532092883d1fdde654e707d 100644 (file)
@@ -38,9 +38,8 @@ static int xmlpoints;
 /* options */
 static char* index_opt = nullptr;
 
-static arglist_t ignr_args[] = {
+static QVector<arglist_t> ignr_args = {
   {"index", &index_opt, "Index of track to write (if more than one in source)", nullptr, ARGTYPE_INT, "1", nullptr , nullptr},
-  ARG_TERMINATOR
 };
 
 
@@ -254,7 +253,7 @@ ff_vecs_t ignr_vecs = {
   ignr_read,
   ignr_write,
   nullptr,
-  ignr_args,
+  &ignr_args,
   CET_CHARSET_MS_ANSI, 1
   , NULL_POS_OPS,
   nullptr
diff --git a/igo8.cc b/igo8.cc
index b33a96a60db0474c731f7b5039643be5322de66b..c89c3bea8aec00b0aaff953bc26ef6a55c81300c 100644 (file)
--- a/igo8.cc
+++ b/igo8.cc
@@ -108,11 +108,10 @@ static uint32_t point_count;
 static int in_point_count;
 
 // Exported options list
-static arglist_t igo8_options[] = {
+static QVector<arglist_t> igo8_options = {
   { "tracknum", &igo8_option_tracknum, "Track identification number", nullptr, ARGTYPE_INT, ARG_NOMINMAX, nullptr },
   { "title", &igo8_option_title, "Track title", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
   { "description", &igo8_option_description, "Track description", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
-  ARG_TERMINATOR
 };
 
 // Sanity check
@@ -364,7 +363,7 @@ ff_vecs_t igo8_vecs = {
   igo8_read,
   igo8_write,
   nullptr,
-  igo8_options,
+  &igo8_options,
   CET_CHARSET_UTF8,
   1
   , NULL_POS_OPS,
diff --git a/ik3d.cc b/ik3d.cc
index ad4345004696c77bcfeceae9e5b7bb3035ca35d7..a204626e0b11056ab4746c79365df40e1982c929 100644 (file)
--- a/ik3d.cc
+++ b/ik3d.cc
@@ -25,8 +25,7 @@
 #include "xmlgeneric.h"
 #include <QtCore/QXmlStreamAttributes>
 
-static arglist_t ikt_args[] = {
-  ARG_TERMINATOR
+static QVector<arglist_t> ikt_args = {
 };
 
 #define MYNAME "ikt"
@@ -157,7 +156,7 @@ ff_vecs_t ik3d_vecs = {
   ikt_read,
   nullptr,
   nullptr,
-  ikt_args,
+  &ikt_args,
   CET_CHARSET_UTF8, 1
   , NULL_POS_OPS,
   nullptr
index d3bf38f8b663477590d12a685e51c77e1986d073..dbb0d9ecf17bc89c0f35d2f9369fed3e25dac1bb 100644 (file)
@@ -30,9 +30,9 @@
 class InterpolateFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -44,7 +44,7 @@ private:
   double dist = 0;
   char* opt_route = nullptr;
 
-  arglist_t args[4] = {
+  QVector<arglist_t> args = {
     {
       "time", &opt_interval, "Time interval in seconds", nullptr,
       ARGTYPE_BEGIN_EXCL | ARGTYPE_BEGIN_REQ | ARGTYPE_INT,
@@ -59,7 +59,6 @@ private:
       "route", &opt_route, "Interpolate routes instead", nullptr,
       ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
 };
index be0d19e851ac8159fd812f97e0304cb6a88578a0..2c0403ec902ddc429c1f3e6ea74885fc6b41be62 100644 (file)
@@ -359,11 +359,10 @@ init_device()
 // Values for ARGTYPE_xxx can be found in defs.h and are used to
 // select the type of option.
 static
-arglist_t itracku_args[] = {
+QVector<arglist_t> itracku_args = {
   { "backup", &backup_file_name, "Appends the input to a backup file", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
   { "new", &only_new, "Only waypoints that are not the backup file", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
 //   "default", ARGYTPE_STRING, ARG_NOMINMAX} ,
-  ARG_TERMINATOR
 };
 
 /*******************************************************************************
@@ -781,7 +780,7 @@ ff_vecs_t itracku_vecs = {
   itracku_read,
   nullptr,
   itracku_exit,
-  itracku_args,
+  &itracku_args,
   CET_CHARSET_ASCII, 0, /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   { itracku_rt_init, itracku_rt_position, itracku_rt_deinit, nullptr, nullptr, nullptr },
@@ -802,7 +801,7 @@ ff_vecs_t itracku_fvecs = {
   itracku_read,
   itracku_write,
   itracku_exit,
-  itracku_args,
+  &itracku_args,
   CET_CHARSET_ASCII, 0, /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr },
index c6496b220c8465bcf87538d24954180de600a17f..630212d3da6cf362e49da0440f2946057c8b6d38 100644 (file)
--- a/jogmap.cc
+++ b/jogmap.cc
@@ -29,8 +29,7 @@
 
 static route_head* trk;
 
-static arglist_t jogmap_args[] = {
-  ARG_TERMINATOR
+static QVector<arglist_t> jogmap_args = {
 };
 
 #define MYNAME "xol"
@@ -107,7 +106,7 @@ ff_vecs_t jogmap_vecs = {
   jogmap_read,
   nullptr,
   nullptr,
-  jogmap_args,
+  &jogmap_args,
   CET_CHARSET_UTF8, 0
   , NULL_POS_OPS,
   nullptr
diff --git a/jtr.cc b/jtr.cc
index 07dd3e1ed367ec4cc0d3c3e6e8823fef6d106bc7..19e7f3013cf468afda54238692cd7a8a5a9b2bf4 100644 (file)
--- a/jtr.cc
+++ b/jtr.cc
@@ -30,8 +30,7 @@
 #define MYNAME "jtr"
 
 static
-arglist_t jtr_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> jtr_args = {
 };
 
 static gbfile* fin, *fout;
@@ -337,7 +336,7 @@ ff_vecs_t jtr_vecs = {
   jtr_read,
   jtr_write,
   nullptr,
-  jtr_args,
+  &jtr_args,
   CET_CHARSET_ASCII, 0                 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
diff --git a/kml.cc b/kml.cc
index b9266c984d789a664243d4a16b4f9d24e99827c7..fa2e7e12e234e92a429b1e4c67a97eef3d7d3f8c 100644 (file)
--- a/kml.cc
+++ b/kml.cc
@@ -124,7 +124,7 @@ static const char kmt_power[] = "power";
 
 
 static
-arglist_t kml_args[] = {
+QVector<arglist_t> kml_args = {
   {"deficon", &opt_deficon, "Default icon name", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
   {
     "lines", &opt_export_lines,
@@ -196,7 +196,6 @@ arglist_t kml_args[] = {
     "Precision of coordinates, number of decimals",
     DEFAULT_PRECISION, ARGTYPE_INT, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static
@@ -2224,7 +2223,7 @@ ff_vecs_t kml_vecs = {
   kml_read,
   kml_write,
   nullptr,
-  kml_args,
+  &kml_args,
   CET_CHARSET_UTF8, 1, /* CET-REVIEW */
   { nullptr, nullptr, nullptr, kml_wr_position_init, kml_wr_position, kml_wr_position_deinit },
   nullptr
diff --git a/lmx.cc b/lmx.cc
index b91552bd672d824718a008ce73d71a6b5e16d43d..2ed8186db42a63420fb118ef2e130921c0c76c74 100644 (file)
--- a/lmx.cc
+++ b/lmx.cc
@@ -43,13 +43,12 @@ static char* binary = nullptr;
 #define MYNAME "lmx"
 
 static
-arglist_t lmx_args[] = {
+QVector<arglist_t> lmx_args = {
   {
     "binary", &binary,
     "Compact binary representation",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 /*
@@ -411,7 +410,7 @@ ff_vecs_t lmx_vecs = {
   lmx_read,
   lmx_write,
   nullptr,
-  lmx_args,
+  &lmx_args,
   CET_CHARSET_UTF8, 0  /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 9a14220e26fcd35a3b11aefe73572b2e65b82754..16334eb4c01862692fc81e420105caf5ae52e14b 100644 (file)
@@ -692,7 +692,7 @@ lowranceusr4_find_index_from_icon_desc_and_color_desc(const QString& icon, const
 // Combined arguments from previous lowranceusr and lowranceusr4 into single set.
 // Use output format specified to determine if args are ignored.
 static
-arglist_t lowranceusr_args[] = {
+QVector<arglist_t> lowranceusr_args = {
   {
     // Ignore Event Marker ICONs in input data
     "ignoreicons", &opt_ignoreicons, "(USR input) Ignore event marker icons on read",
@@ -732,7 +732,6 @@ arglist_t lowranceusr_args[] = {
     "", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
 
-  ARG_TERMINATOR
 };
 
 static void
@@ -2457,7 +2456,7 @@ ff_vecs_t lowranceusr_vecs = {
   data_read,
   data_write,
   nullptr,
-  lowranceusr_args,
+  &lowranceusr_args,
   CET_CHARSET_ASCII, 0   /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index a0560a082f029fc4d13e4d39ba230f5af757bc05..2e8bc8f210b28efdec149ecc54f82471e6c17982 100644 (file)
@@ -684,7 +684,7 @@ static void termdeinit()
  *  Arg tables are doubled up so that -? can output appropriate help
  */
 static
-arglist_t mag_sargs[] = {
+QVector<arglist_t> mag_sargs = {
   {
     "deficon", &deficon, "Default icon name", nullptr, ARGTYPE_STRING,
     ARG_NOMINMAX, nullptr
@@ -705,11 +705,10 @@ arglist_t mag_sargs[] = {
     "nukewpt", &nukewpt, "Delete all waypoints", nullptr, ARGTYPE_BOOL,
     ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static
-arglist_t mag_fargs[] = {
+QVector<arglist_t> mag_fargs = {
   {
     "deficon", &deficon, "Default icon name", nullptr, ARGTYPE_STRING,
     ARG_NOMINMAX, nullptr
@@ -718,7 +717,6 @@ arglist_t mag_fargs[] = {
     "maxcmts", &cmts, "Max number of comments to write (maxcmts=200)",
     nullptr, ARGTYPE_INT, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 /*
@@ -1606,7 +1604,7 @@ ff_vecs_t mag_svecs = {
   mag_read,
   mag_write,
   nullptr,
-  mag_sargs,
+  &mag_sargs,
   CET_CHARSET_ASCII, 0,        /* CET-REVIEW */
   NULL_POS_OPS,
   nullptr,
@@ -1622,7 +1620,7 @@ ff_vecs_t mag_fvecs = {
   mag_read,
   mag_write,
   nullptr,
-  mag_fargs,
+  &mag_fargs,
   CET_CHARSET_ASCII, 0,        /* CET-REVIEW */
   NULL_POS_OPS,
   nullptr,
@@ -1641,7 +1639,7 @@ ff_vecs_t magX_fvecs = {
   mag_read,
   mag_write,
   nullptr,
-  mag_fargs,
+  &mag_fargs,
   CET_CHARSET_ASCII, 0,        /* CET-REVIEW */
   NULL_POS_OPS,
   nullptr,
index 7c60cb053565905a9831dccbad872ba5176f9b91..dee405b1579020279d6f10c67d9ffdafa5426e22 100644 (file)
@@ -61,8 +61,7 @@ static const route_head* trk_tmp;
 static int course_tmp, speed_tmp;
 
 static
-arglist_t tr7_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> tr7_args = {
 };
 
 /*******************************************************************************
@@ -300,7 +299,7 @@ ff_vecs_t mapasia_tr7_vecs = {              /* we can read and write tracks */
   tr7_read,
   tr7_write,
   nullptr,
-  tr7_args,
+  &tr7_args,
   CET_CHARSET_UTF8, 1  /* FIXED - CET-REVIEW - */
   , NULL_POS_OPS,
   nullptr
index daf26284d977e003fa159bd2c8da57e9db682477..f9165a5610092bbd1d3325f501c2968c72cd4254 100644 (file)
@@ -29,8 +29,7 @@
 static gbfile* fin;
 
 static
-arglist_t mapbar_track_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> mapbar_track_args = {
 };
 
 /*******************************************************************************
@@ -140,7 +139,7 @@ ff_vecs_t mapbar_track_vecs = {
   mapbar_track_read,
   nullptr,
   nullptr,
-  mapbar_track_args,
+  &mapbar_track_args,
   CET_CHARSET_UTF8, 0
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
index 1c4c2dd8fb059cde465ae31dc8a43489005e6367..44b97a443648e6ca26f4fad891c7f3aca7d482ec 100644 (file)
@@ -27,8 +27,7 @@ static gpsbabel::File* oqfile;
 static QXmlStreamWriter* writer;
 
 static
-arglist_t mapfactor_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> mapfactor_args = {
 };
 
 #define MYNAME "mapfactor"
@@ -156,7 +155,7 @@ ff_vecs_t mapfactor_vecs = {
   mapfactor_read,
   mapfactor_write,
   nullptr,
-  mapfactor_args,
+  &mapfactor_args,
   CET_CHARSET_UTF8, 0  /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index d8932de36dc7d3367e407a9349e6ebd2b35e2a3b..ed67f063206a946b61d936f9941dde410845d0f3 100644 (file)
@@ -52,13 +52,12 @@ static char* mapsend_opt_trkver = nullptr;
 #define MAPSEND_TRKVER_MAX 4
 
 static
-arglist_t mapsend_args[] = {
+QVector<arglist_t> mapsend_args = {
   {
     "trkver", &mapsend_opt_trkver,
     "MapSend version TRK file to generate (3,4)",
     "4", ARGTYPE_INT, "3", "4", nullptr
   },
-  ARG_TERMINATOR
 };
 
 static void
@@ -546,7 +545,7 @@ ff_vecs_t mapsend_vecs = {
   mapsend_read,
   mapsend_wpt_write,
   nullptr,
-  mapsend_args,
+  &mapsend_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 72c26eb673db7b89009aa09e6d4f1162bfd2585a..82f6c1ae23ba21f77b03a5d93b4d0f4739122437 100644 (file)
@@ -87,7 +87,7 @@ static char* mpsusedepth = nullptr;
 static char* mpsuseprox = nullptr;
 
 static
-arglist_t mps_args[] = {
+QVector<arglist_t> mps_args = {
   {
     "snlen", &snlen, "Length of generated shortnames", "10", ARGTYPE_INT, "1",
     nullptr, nullptr
@@ -115,7 +115,6 @@ arglist_t mps_args[] = {
     "Use proximity values on output (default is ignore)",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static void
@@ -2048,7 +2047,7 @@ ff_vecs_t mps_vecs = {
   mps_read,
   mps_write,
   nullptr,
-  mps_args,
+  &mps_args,
   CET_CHARSET_MS_ANSI, 0,      /* CET-REVIEW */
   NULL_POS_OPS,
   nullptr,
diff --git a/mmo.cc b/mmo.cc
index d9e7fcdb0a20d7e42320190631253670508c0fcd..6497243126c6a7104d27d3b5ea2b83ba317a3c9a 100644 (file)
--- a/mmo.cc
+++ b/mmo.cc
@@ -52,7 +52,7 @@
 static char* opt_locked, *opt_visible, *opt_version;
 
 static
-arglist_t mmo_args[] = {
+QVector<arglist_t> mmo_args = {
   {
     "locked", &opt_locked, "Write items 'locked' [default no]", "0",
     ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -65,7 +65,6 @@ arglist_t mmo_args[] = {
     "ver", &opt_version, "Write files with internal version [n]", nullptr,
     ARGTYPE_INT, "17", "18", nullptr
   },
-  ARG_TERMINATOR
 };
 
 struct mmo_data_t {
@@ -1467,7 +1466,7 @@ ff_vecs_t mmo_vecs = {
   mmo_read,
   mmo_write,
   nullptr,
-  mmo_args,
+  &mmo_args,
   CET_CHARSET_MS_ANSI, 0
   , NULL_POS_OPS,
   nullptr
index e2ecf113ff779316893b7dbf0d9090154a75e6e0..912da92a23bc4c92b8f13d6f31df772be2837cc3 100644 (file)
@@ -51,13 +51,12 @@ static char* opt_erase;
 static char* opt_status;
 static char* opt_enable;
 
-static arglist_t mtk_locus_args[] = {
+static QVector<arglist_t> mtk_locus_args = {
   {"baudrate", &opt_baudrate, "Speed in bits per second of serial port (autodetect=0)", "0", ARGTYPE_INT, ARG_NOMINMAX , nullptr},
   {"download", &opt_download, "Download logged fixes", "1", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
   {"erase", &opt_erase, "Erase device data after download", "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
   {"status", &opt_status, "Show device status", "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
   {"enable", &opt_enable, "Enable logging after download", "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
-  ARG_TERMINATOR
 };
 
 static void mtk_locus_rd_init(const QString& fname);
@@ -78,7 +77,7 @@ ff_vecs_t mtk_locus_vecs = {
   mtk_locus_read,
   nullptr,  // write
   nullptr, // exit
-  mtk_locus_args,
+  &mtk_locus_args,
   CET_CHARSET_ASCII, 0 /* ascii is the expected character set */
   , NULL_POS_OPS,
   nullptr
index b7687240af74ccf47e51512c38a1273e017f0c03..3b47f0544dece0fb32d6b72fcfe8c88976e734c4 100644 (file)
@@ -263,7 +263,7 @@ static int mtk_parse_info(const unsigned char* data, int dataLen);
 
 // Arguments for log fetch 'mtk' command..
 
-static arglist_t mtk_sargs[] = {
+static QVector<arglist_t> mtk_sargs = {
   {
     "erase", &OPT_erase, "Erase device data after download",
     "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -284,7 +284,6 @@ static arglist_t mtk_sargs[] = {
     "block_size_kb", &OPT_block_size_kb, "Size of blocks in KB to request from device",
     "1", ARGTYPE_INT, "1", "64", nullptr
   },
-  ARG_TERMINATOR
 };
 
 static void dbg(int l, const char* msg, ...)
@@ -1675,7 +1674,7 @@ ff_vecs_t mtk_vecs = {
   mtk_read,
   nullptr,
   nullptr,
-  mtk_sargs,
+  &mtk_sargs,
   CET_CHARSET_ASCII, 0                 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
@@ -1696,7 +1695,7 @@ ff_vecs_t mtk_m241_vecs = {
   mtk_read,
   nullptr,
   nullptr,
-  mtk_sargs,
+  &mtk_sargs,
   CET_CHARSET_ASCII, 0                 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
@@ -1705,12 +1704,11 @@ ff_vecs_t mtk_m241_vecs = {
 
 /* used for mtk-bin */
 
-static arglist_t mtk_fargs[] = {
+static QVector<arglist_t> mtk_fargs = {
   {
     "csv",   &csv_file, "MTK compatible CSV output file",
     nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 ff_vecs_t mtk_fvecs = {
@@ -1723,7 +1721,7 @@ ff_vecs_t mtk_fvecs = {
   file_read,
   nullptr,
   nullptr,
-  mtk_fargs,
+  &mtk_fargs,
   CET_CHARSET_UTF8, 1         /* master process: don't convert anything | CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
@@ -1739,7 +1737,7 @@ ff_vecs_t mtk_m241_fvecs = {
   file_read,
   nullptr,
   nullptr,
-  mtk_fargs,
+  &mtk_fargs,
   CET_CHARSET_UTF8, 1         /* master process: don't convert anything | CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 835e4e9cf0a4ff53324aa46f7efe63e08a855ce0..926ed9e52619b3364dd3cc496bfea27709b7014e 100644 (file)
@@ -25,12 +25,11 @@ static char* noretired = nullptr;
 static QString read_fname;
 
 static
-arglist_t nav_args[] = {
+QVector<arglist_t> nav_args = {
   {
     "noretired", &noretired, "Suppress retired geocaches",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 #define MYNAME "navicache"
@@ -214,7 +213,7 @@ ff_vecs_t navicache_vecs = {
   nav_read,
   nullptr,
   nullptr,
-  nav_args,
+  &nav_args,
   CET_CHARSET_UTF8, 0  /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 9521b8c4506158c62de24a4efdd907fff22eec31..b31c47309a902163be750f835ecb75dc25ca6db9 100644 (file)
@@ -92,7 +92,7 @@ static char temp_short_name[5];
 static void ng_read_file_header();
 
 static
-arglist_t ng_args[] = {
+QVector<arglist_t> ng_args = {
   {
     "output", &process, "'wp' - Create waypoint file , 'rte' - Create route file",
     "rte", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
@@ -102,7 +102,6 @@ arglist_t ng_args[] = {
     "n", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
 
-  ARG_TERMINATOR
 };
 
 /*===================Utilities ==========================================*/
@@ -417,7 +416,7 @@ ff_vecs_t ng_vecs = {
   data_read,
   data_write,
   nullptr,
-  ng_args,
+  &ng_args,
   CET_CHARSET_HEBREW, 0
   , NULL_POS_OPS,
   nullptr
index b7df0c1b31f253b43f32e198fd80ad07f1d30d1b..67acafee7c1e8ea1d588663d2b17b34d8254565a 100644 (file)
@@ -138,7 +138,7 @@ const char* const icon_table[] = {
 };
 
 static
-arglist_t navilink_args[] = {
+QVector<arglist_t> navilink_args = {
   {
     "nuketrk", &nuketrk, "Delete all track points", nullptr, ARGTYPE_BOOL,
     ARG_NOMINMAX, nullptr
@@ -163,7 +163,6 @@ arglist_t navilink_args[] = {
     "power_off", &poweroff, "Command unit to power itself down",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static void (*write_waypoint)(const Waypoint*) = nullptr;
@@ -1207,7 +1206,7 @@ ff_vecs_t navilink_vecs = {
   navilink_read,
   navilink_write,
   nullptr,
-  navilink_args,
+  &navilink_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index ed98684248cede7ddb4a7890c7b044ff0128c7ab..c011c74a647e45072416aa9668b847dc50d6abfc 100644 (file)
@@ -48,7 +48,7 @@ static void   fix_netstumbler_dupes();
 #define MYNAME "NETSTUMBLER"
 
 static
-arglist_t netstumbler_args[] = {
+QVector<arglist_t> netstumbler_args = {
   {
     "nseicon", &nseicon, "Non-stealth encrypted icon name",
     "Red Square", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
@@ -69,7 +69,6 @@ arglist_t netstumbler_args[] = {
     "snmac", &snmac, "Shortname is MAC address", nullptr, ARGTYPE_BOOL,
     ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static void
@@ -343,7 +342,7 @@ ff_vecs_t netstumbler_vecs = {
   data_read,
   nullptr,
   nullptr,
-  netstumbler_args,
+  &netstumbler_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
diff --git a/nmea.cc b/nmea.cc
index fd94bbebf98c6426da4707e6d8a06fb0c11dc86b..2fdb7cea038614e2bd5bbc6bbedc50b7b31f9c5a 100644 (file)
--- a/nmea.cc
+++ b/nmea.cc
@@ -215,7 +215,7 @@ static int had_checksum;
 static Waypoint* nmea_rd_posn(posn_status*);
 static void nmea_rd_posn_init(const QString& fname);
 
-static arglist_t nmea_args[] = {
+static QVector<arglist_t> nmea_args = {
   {"snlen", &snlenopt, "Max length of waypoint name to write", "6", ARGTYPE_INT, "1", "64", nullptr },
   {"gprmc", &opt_gprmc, "Read/write GPRMC sentences", "1", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
   {"gpgga", &opt_gpgga, "Read/write GPGGA sentences", "1", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
@@ -231,7 +231,6 @@ static arglist_t nmea_args[] = {
   {"baud", &opt_baud, "Speed in bits per second of serial port (baud=4800)", nullptr, ARGTYPE_INT, ARG_NOMINMAX, nullptr },
   {"gisteq", &opt_gisteq, "Write tracks for Gisteq Phototracker", "0", ARGTYPE_BOOL, ARG_NOMINMAX , nullptr},
   {"ignore_fix", &opt_ignorefix, "Accept position fixes in gpgga marked invalid", "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr},
-  ARG_TERMINATOR
 };
 
 #define CHECK_BOOL(a) if (a && (*a == '0')) a = NULL
@@ -1419,7 +1418,7 @@ ff_vecs_t nmea_vecs = {
   nmea_read,
   nmea_write,
   nullptr,
-  nmea_args,
+  &nmea_args,
   CET_CHARSET_ASCII, 0, /* CET-REVIEW */
   {
     nmea_rd_posn_init, nmea_rd_posn, nmea_rd_deinit,
diff --git a/nmn4.cc b/nmn4.cc
index c2b0c2c9e69f268c036849c04e28091cf915a915..2b40b2889fa9c0c01be7b9af4a497af392b586ea 100644 (file)
--- a/nmn4.cc
+++ b/nmn4.cc
@@ -42,9 +42,8 @@ static int curr_rte_num, target_rte_num;
 static char* index_opt;
 
 static
-arglist_t nmn4_args[] = {
+QVector<arglist_t> nmn4_args = {
   {"index", &index_opt, "Index of route to write (if more than one in source)", nullptr, ARGTYPE_INT, "1", nullptr , nullptr},
-  ARG_TERMINATOR
 };
 
 
@@ -285,7 +284,7 @@ ff_vecs_t nmn4_vecs = {
   nmn4_read,
   nmn4_write,
   nullptr,
-  nmn4_args,
+  &nmn4_args,
   CET_CHARSET_MS_ANSI, 1       /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 8ab3f779dceb8dec3ecbe08358419a3337e92d82..2c7c87f054ff171069e8590651efac06f10a5af7 100644 (file)
@@ -31,9 +31,9 @@
 class NukeDataFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void process() override;
 
@@ -42,7 +42,7 @@ private:
   char* nuketrks;
   char* nukertes;
 
-  arglist_t args[4] = {
+  QVector<arglist_t> args = {
     {
       "waypoints", &nukewpts, "Remove all waypoints from data stream",
       "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -55,7 +55,6 @@ private:
       "routes", &nukertes, "Remove all routes from data stream",
       "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
 };
diff --git a/osm.cc b/osm.cc
index fbda1a47cf1ae9b5cf94683c67683462f20ba902..dd0f80ca923e3b107c0cdf7d478863f32e9d671a 100644 (file)
--- a/osm.cc
+++ b/osm.cc
 
 static char* opt_tag, *opt_tagnd, *created_by;
 
-static arglist_t osm_args[] = {
+static QVector<arglist_t> osm_args = {
   { "tag", &opt_tag,   "Write additional way tag key/value pairs", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
   { "tagnd", &opt_tagnd,       "Write additional node tag key/value pairs", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
   { "created_by", &created_by, "Use this value as custom created_by value","GPSBabel", ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
-  ARG_TERMINATOR
 };
 
 #define MYNAME "osm"
@@ -978,7 +977,7 @@ ff_vecs_t osm_vecs = {
   osm_read,
   osm_write,
   osm_exit,
-  osm_args,
+  &osm_args,
   CET_CHARSET_UTF8, 0
   , NULL_POS_OPS,
   nullptr};
diff --git a/ozi.cc b/ozi.cc
index e5f3d1a1d6d860b3bbd367e733a7f0f9af8ef4b1..9f15409f1fc98bb8b3d5d8becd61988bdca3b6d5 100644 (file)
--- a/ozi.cc
+++ b/ozi.cc
@@ -99,7 +99,7 @@ static double prox_scale;
 static char* opt_codec;
 
 static
-arglist_t ozi_args[] = {
+QVector<arglist_t> ozi_args = {
   {
     "pack", &pack_opt, "Write all tracks into one file",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -144,7 +144,6 @@ arglist_t ozi_args[] = {
     "codec", &opt_codec, "codec to use for reading and writing strings (default windows-1252)",
     "windows-1252", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static gpsdata_type ozi_objective;
@@ -985,7 +984,7 @@ ff_vecs_t ozi_vecs = {
   data_read,
   data_write,
   nullptr,
-  ozi_args,
+  &ozi_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
diff --git a/pcx.cc b/pcx.cc
index a6dd3b064ccce4126c7e91937dba6890a858befe..683e14f90de0445d617f922b7eba0d555b407cf9 100644 (file)
--- a/pcx.cc
+++ b/pcx.cc
@@ -43,12 +43,12 @@ static int lon_col;
 
 #define MYNAME "PCX"
 
-static arglist_t pcx_args[] = {{"deficon", &deficon, "Default icon name",
+static QVector<arglist_t> pcx_args = {{"deficon", &deficon, "Default icon name",
                                 "Waypoint", ARGTYPE_STRING, ARG_NOMINMAX, nullptr},
                                {"cartoexploreur", &cartoexploreur,
                                 "Write tracks compatible with Carto Exploreur",
                                 nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr},
-                               ARG_TERMINATOR};
+                               };
 
 static void rd_init(const QString& fname) {
   file_in = gbfopen(fname, "rb", MYNAME);
@@ -403,7 +403,7 @@ static void data_write() {
 
 ff_vecs_t pcx_vecs = {
     ff_type_file,      FF_CAP_RW_ALL, rd_init,    wr_init, rd_deinit,
-    wr_deinit,         data_read,     data_write, nullptr,    pcx_args,
+    wr_deinit,         data_read,     data_write, nullptr,    &pcx_args,
     CET_CHARSET_ASCII, 1 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index a4d5f36025f438d6f7eec45015ac0abd316ea5ac..893273cfacbc400e4e81e3a57fe74d4427159fda 100644 (file)
--- a/polygon.h
+++ b/polygon.h
@@ -30,9 +30,9 @@
 class PolygonFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void process() override;
 
@@ -45,7 +45,7 @@ private:
     unsigned short override;
   };
 
-  arglist_t args[3] = {
+  QVector<arglist_t> args = {
     {
       "file", &polyfileopt,  "File containing vertices of polygon",
       nullptr, ARGTYPE_FILE | ARGTYPE_REQUIRED, ARG_NOMINMAX, nullptr
@@ -54,7 +54,6 @@ private:
       "exclude", &exclopt, "Exclude points inside the polygon",
       nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   void polytest(double lat1, double lon1,
index 4637892d09d7d47fbbb9514d5f08d377da9389a5..db95575e4be279e1aa4cf44bdee5f89875c342ce 100644 (file)
@@ -30,9 +30,9 @@
 class PositionFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -47,7 +47,7 @@ private:
   char* purge_duplicates = nullptr;
   bool check_time;
 
-  arglist_t args[4] = {
+  QVector<arglist_t> args = {
     {
       "distance", &distopt, "Maximum positional distance",
       nullptr, ARGTYPE_FLOAT | ARGTYPE_REQUIRED, ARG_NOMINMAX, nullptr
@@ -61,7 +61,6 @@ private:
       "time", &timeopt, "Maximum time in seconds between two points",
       nullptr, ARGTYPE_FLOAT | ARGTYPE_REQUIRED, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   class WptRecord
index 0e008cd3a718349bd9a5ed9d2e114b94bcc76089..7fc1d8ed295ab40b8f6519821c67c2605d7d78de 100644 (file)
@@ -65,10 +65,9 @@ static char psit_current_token[256];
 static char* snlen;
 
 static
-arglist_t psit_args[] = {
+QVector<arglist_t> psit_args = {
   /*   {"snlen", &snlen, "Length of generated shortnames",
        NULL, ARGTYPE_INT, "1", NULL }, */
-  ARG_TERMINATOR
 };
 
 /* Taken from PsiTrex 1.13 */
@@ -781,7 +780,7 @@ ff_vecs_t psit_vecs = {
   psit_read,
   psit_write,
   nullptr,
-  psit_args,
+  &psit_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 30c949d116a0f10377fee94b0440175012b7d632..1a00c62c94da04e9ca4bfa9fe5456f125286bb3a 100644 (file)
--- a/radius.h
+++ b/radius.h
@@ -30,9 +30,9 @@
 class RadiusFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -55,7 +55,7 @@ private:
     double distance;
   };
 
-  arglist_t args[8] = {
+  QVector<arglist_t> args = {
     {
       "lat", &latopt,       "Latitude for center point (D.DDDDD)",
       nullptr, ARGTYPE_FLOAT | ARGTYPE_REQUIRED, ARG_NOMINMAX, nullptr
@@ -84,7 +84,6 @@ private:
       "asroute", &routename,"Put resulting waypoints in route of this name",
       nullptr, ARGTYPE_STRING, nullptr, nullptr, nullptr
     },
-    ARG_TERMINATOR
   };
 
   double gc_distance(double lat1, double lon1, double lat2, double lon2);
index 21e396ae451f920a30c558d989efa32a3de9425d..057df2f5c53a6b2be7e8e8fa9b8ef28e34cc3a0f 100644 (file)
--- a/random.cc
+++ b/random.cc
@@ -32,7 +32,7 @@
 
 static char* opt_points, *opt_seed, *opt_nodelay;
 
-static arglist_t random_args[] = {
+static QVector<arglist_t> random_args = {
   {
     "points", &opt_points, "Generate # points", nullptr,
     ARGTYPE_INT, "1", nullptr, nullptr
@@ -45,7 +45,6 @@ static arglist_t random_args[] = {
     "nodelay", &opt_nodelay, "Output realtime points without delay", nullptr,
     ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 //  this generator is invariant across platforms.
@@ -348,7 +347,7 @@ ff_vecs_t random_vecs = {
   random_read,
   nullptr,     /* write */
   nullptr,     /* exit */
-  random_args,
+  &random_args,
   CET_CHARSET_ASCII, 1,                        /* fixed */
   {
   random_rd_posn_init, random_rd_posn, random_rd_posn_deinit,
index 55fd3fd17f37e4e7268cebebb70d70fb80c05613..761a55092a1604034ba69af487eb0ab98975550f 100644 (file)
@@ -65,9 +65,8 @@ static char* opt_location;
 #define MYNAME "raymarine"
 
 static
-arglist_t raymarine_args[] = {
+QVector<arglist_t> raymarine_args = {
   { "location", &opt_location, "Default location", "My Waypoints", ARGTYPE_STRING, ARG_NOMINMAX , nullptr},
-  ARG_TERMINATOR
 };
 
 /* from csv_util.c: convert excel time (days since 1900) to time_t and back again */
@@ -508,7 +507,7 @@ ff_vecs_t raymarine_vecs = {
   raymarine_read,
   raymarine_write,
   nullptr,
-  raymarine_args,
+  &raymarine_args,
   CET_CHARSET_ASCII, 0 /* should we force this to 1 ? */
   , NULL_POS_OPS,
   nullptr
index a3b421ee2ec38316f872068a46a25cb8cd2da58b..9dc9f3ce0e7252a9d8479deabfda2ca2e22bd644 100644 (file)
 class ReverseRouteFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
 
 private:
   int prev_new_trkseg;
-  arglist_t args[1] = {
-    ARG_TERMINATOR
+  QVector<arglist_t> args = {
   };
 
   void reverse_route_wpt(const Waypoint* waypointp);
index 75cfe6cdd1a973eda7174d8eef5b095a35bd7754..6fcd6609a275c0342aba37bd6e2cc5bd4b5f10da 100644 (file)
@@ -36,7 +36,7 @@ static char* timesynth = nullptr;
 static int control = 0;
 
 static
-arglist_t saroute_args[] = {
+QVector<arglist_t> saroute_args = {
   {
     "turns_important", &turns_important,
     "Keep turns if simplify filter is used",
@@ -58,7 +58,6 @@ arglist_t saroute_args[] = {
     "times", &timesynth, "Synthesize track times",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 #define ReadShort(f) gbfgetint16(f)
@@ -457,7 +456,7 @@ ff_vecs_t saroute_vecs = {
   my_read,
   nullptr,
   nullptr,
-  saroute_args,
+  &saroute_args,
   CET_CHARSET_UTF8, 1  /* do nothing | CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
diff --git a/sbn.cc b/sbn.cc
index e7ebe35877e363ec00e24708cecada7266058235..acdd8e36e6442c243c9b1819bf2c06ddb7c4d78f 100644 (file)
--- a/sbn.cc
+++ b/sbn.cc
@@ -27,8 +27,7 @@
 static gbfile* file_handle = nullptr;
 
 static
-arglist_t sbn_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> sbn_args = {
 };
 
 
@@ -320,7 +319,7 @@ ff_vecs_t sbn_vecs = {
   sbn_read,
   nullptr,
   sbn_exit,
-  sbn_args,
+  &sbn_args,
   /* Characters are always encoded in ASCII. Even if the unit is set
    * to Chinese language, only ASCII characters can be entered. */
   CET_CHARSET_ASCII, 0
diff --git a/sbp.cc b/sbp.cc
index aaeed3d0f78b560c1a8fa289406131ad92eaecf6..e594d9520161ac63a3d83e9bc21d13360805c261 100644 (file)
--- a/sbp.cc
+++ b/sbp.cc
@@ -28,8 +28,7 @@
 static gbfile* file_handle = nullptr;
 
 static
-arglist_t sbp_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> sbp_args = {
 };
 
 /*******************************************************************************
@@ -130,7 +129,7 @@ ff_vecs_t sbp_vecs = {
   sbp_read,
   nullptr,
   sbp_exit,
-  sbp_args,
+  &sbp_args,
   CET_CHARSET_ASCII, 0                 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
index 6f0c76128d27227780b45bc967d13a6c3edbfb47..05239e3692f147d7782a7918556581751dfc7556 100644 (file)
--- a/shape.cc
+++ b/shape.cc
@@ -47,7 +47,7 @@ static char* opt_name = nullptr;
 static char* opt_url = nullptr;
 
 static
-arglist_t shp_args[] = {
+QVector<arglist_t> shp_args = {
   {
     "name", &opt_name, "Source for name field in .dbf",
     nullptr, ARGTYPE_STRING, "0", nullptr, nullptr
@@ -56,7 +56,6 @@ arglist_t shp_args[] = {
     "url", &opt_url, "Source for URL field in .dbf",
     nullptr, ARGTYPE_STRING, "0", nullptr, nullptr
   },
-  ARG_TERMINATOR
 };
 
 
@@ -536,7 +535,7 @@ ff_vecs_t shape_vecs = {
   my_read,
   my_write,
   nullptr,
-  shp_args,
+  &shp_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index fd149e19d86e0d78df60938fae2cf87bebfe4207..80faa2f536c7eecabcbf17c4924ecedee140a691 100644 (file)
@@ -31,8 +31,7 @@
 
 
 static
-arglist_t skyforce_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> skyforce_args = {
 };
 
 static gbfile* fin, *fout;
@@ -378,7 +377,7 @@ ff_vecs_t skyforce_vecs = {
   skyforce_read,
   skyforce_write,
   nullptr,
-  skyforce_args,
+  &skyforce_args,
   CET_CHARSET_ASCII, 1
   , NULL_POS_OPS,
   nullptr
index 737dbae98eea0c57193f86e33c5caadfa04c5969..1703842f553299a7bd5b449885fe5dc7c2fe9c32 100644 (file)
@@ -73,7 +73,7 @@ static char* opt_gps_utc_offset = nullptr;
 static char* opt_gps_week_rollover = nullptr;
 
 static
-arglist_t skytraq_args[] = {
+QVector<arglist_t> skytraq_args = {
   {
     "erase", &opt_erase, "Erase device data after download",
     "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -122,11 +122,10 @@ arglist_t skytraq_args[] = {
     "gps-week-rollover", &opt_gps_week_rollover, "GPS week rollover period we're in (-1: best guess)",
     "-1", ARGTYPE_INT, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR,
 };
 
 static
-arglist_t skytraq_fargs[] = {
+QVector<arglist_t> skytraq_fargs = {
   {
     "first-sector", &opt_first_sector, "First sector to be read from the file",
     "0", ARGTYPE_INT, "0", "65535", nullptr
@@ -143,7 +142,6 @@ arglist_t skytraq_fargs[] = {
     "gps-week-rollover", &opt_gps_week_rollover, "GPS week rollover period we're in (-1: best guess)",
     "-1", ARGTYPE_INT, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static void
@@ -1437,7 +1435,7 @@ ff_vecs_t skytraq_vecs = {
   skytraq_read,
   nullptr,
   nullptr,
-  skytraq_args,
+  &skytraq_args,
   CET_CHARSET_UTF8, 1         /* master process: don't convert anything */
  , NULL_POS_OPS,
  nullptr
@@ -1457,7 +1455,7 @@ ff_vecs_t skytraq_fvecs = {
   file_read,
   nullptr,
   nullptr,
-  skytraq_fargs,
+  &skytraq_fargs,
   CET_CHARSET_UTF8, 1         /* master process: don't convert anything */
  , NULL_POS_OPS,
  nullptr
@@ -1477,7 +1475,7 @@ static char* opt_set_poi_car = nullptr;   /* set if a "poi" option was used */
 static char* opt_set_poi_boat = nullptr;       /* set if a "poi" option was used */
 static char* opt_set_poi_heart = nullptr;      /* set if a "poi" option was used */
 static char* opt_set_poi_bar = nullptr;        /* set if a "poi" option was used */
-static arglist_t miniHomer_args[] = {
+static QVector<arglist_t> miniHomer_args = {
   { "baud",         &opt_dlbaud,        "Baud rate used for download", "115200", ARGTYPE_INT, "0", "115200", nullptr },
   { "dump-file",    &opt_dump_file,     "Dump raw data to this file", nullptr, ARGTYPE_OUTFILE, ARG_NOMINMAX, nullptr },
   { "erase",        &opt_erase,         "Erase device data after download", "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
@@ -1499,7 +1497,6 @@ static arglist_t miniHomer_args[] = {
     "gps-week-rollover", &opt_gps_week_rollover, "GPS week rollover period we're in (-1: best guess)",
     "-1", ARGTYPE_INT, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 /*
  * Names of the POIs on miniHomer
@@ -1690,7 +1687,7 @@ ff_vecs_t miniHomer_vecs = {
   miniHomer_read,
   nullptr,
   nullptr,
-  miniHomer_args,
+  &miniHomer_args,
   CET_CHARSET_UTF8, 1,         /* master process: don't convert anything */
   NULL_POS_OPS,
   nullptr
index 467d80cd95dee917238512f0fad2dd4e341bba19..21bbaec17a5a4d542c356aabfaaa2fa2c375315f 100644 (file)
@@ -67,9 +67,9 @@
 class SimplifyRouteFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -87,7 +87,7 @@ private:
   char* relopt;
   void (*waypt_del_fnp)(route_head* rte, Waypoint* wpt);
 
-  arglist_t args[6] = {
+  QVector<arglist_t> args = {
     {
       "count", &countopt,  "Maximum number of points in route",
       nullptr, ARGTYPE_INT | ARGTYPE_BEGIN_REQ | ARGTYPE_BEGIN_EXCL, "1", nullptr, nullptr
@@ -108,7 +108,6 @@ private:
       "relative", &relopt, "Use relative error", nullptr,
       ARGTYPE_BOOL | ARGTYPE_END_EXCL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   struct xte_intermed;
diff --git a/sort.h b/sort.h
index 77820f507611013d5693ae20e16771a885114587..ea2af5789bbbc3fc71cb7ec26820dd0d16e64042 100644 (file)
--- a/sort.h
+++ b/sort.h
@@ -30,9 +30,9 @@
 class SortFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -62,7 +62,7 @@ private:
   char* opt_sm_rtenum, *opt_sm_rtename, *opt_sm_rtedesc;
   char* opt_sm_trknum, *opt_sm_trkname, *opt_sm_trkdesc;
 
-  arglist_t args[11] = {
+  QVector<arglist_t> args = {
     {
       "description", &opt_sm_description, "Sort waypoints by description",
       nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -103,7 +103,6 @@ private:
       "trknum", &opt_sm_trknum, "Sort tracks by number",
       nullptr, ARGTYPE_BEGIN_EXCL | ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   static bool sort_comp_wpt_by_description(const Waypoint* a, const Waypoint* b);
index a9afd8404d09b576a9c8ad8b04c12f748935bbfc..c535b716bb0364929dd2eeb778d48c878ef2809f 100644 (file)
@@ -30,9 +30,9 @@
 class StackFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -52,7 +52,7 @@ private:
   int  warnings_enabled = 1;
   int  swapdepth = 0;
 
-  arglist_t args[10] = {
+  QVector<arglist_t> args = {
     {
       "push", &opt_push, "Push waypoint list onto stack", nullptr,
       ARGTYPE_BEGIN_EXCL | ARGTYPE_BEGIN_REQ | ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -89,7 +89,6 @@ private:
       "nowarn", &nowarn, "Suppress cleanup warning", nullptr,
       ARGTYPE_BOOL | ARGTYPE_HIDDEN, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   struct stack_elt
index 647bf4c440ee6f255b8ba20f9ab36a1659f6f0d7..65c98c8c3bf1124d124dc815c3da42ed2727565e 100644 (file)
--- a/stmsdf.cc
+++ b/stmsdf.cc
@@ -106,12 +106,11 @@ static char* opt_route_index;
 static int opt_route_index_value;
 
 static
-arglist_t stmsdf_args[] = {
+QVector<arglist_t> stmsdf_args = {
   {
     "index", &opt_route_index,
     "Index of route (if more than one in source)", "1", ARGTYPE_INT, "1", nullptr, nullptr
   },
-  ARG_TERMINATOR
 };
 
 
@@ -820,7 +819,7 @@ ff_vecs_t stmsdf_vecs = {
   data_read,
   data_write,
   nullptr,
-  stmsdf_args,
+  &stmsdf_args,
   CET_CHARSET_MS_ANSI, 0       /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 2383850ed5b561a422f0276e3e90503d5283b7e7..a75b3141106dfc65ddf2164d5b45f0410e401aa8 100644 (file)
--- a/stmwpp.cc
+++ b/stmwpp.cc
@@ -50,12 +50,11 @@ static int what;
 static char* index_opt = nullptr;
 
 static
-arglist_t stmwpp_args[] = {
+QVector<arglist_t> stmwpp_args = {
   {
     "index", &index_opt, "Index of route/track to write (if more than one in source)",
     nullptr, ARGTYPE_INT, "1", nullptr, nullptr
   },
-  ARG_TERMINATOR
 };
 
 
@@ -328,7 +327,7 @@ ff_vecs_t stmwpp_vecs = {
   stmwpp_data_read,
   stmwpp_data_write,
   nullptr,
-  stmwpp_args,
+  &stmwpp_args,
   CET_CHARSET_MS_ANSI, 0
   , NULL_POS_OPS,
   nullptr
index 89e463bd9af5f67c7e36bd7f420d672d80403e82..9d2ea3c34c970a320de0b3c6bf41fd6d942bf55b 100644 (file)
--- a/subrip.cc
+++ b/subrip.cc
@@ -260,13 +260,12 @@ subrip_write()
 
 /* arguments: definitions of format-specific arguments */
 
-static arglist_t subrip_args[] = {
+static QVector<arglist_t> subrip_args = {
   // FIXME: document that gps_date and gps_time must be specified together or they will both be ignored and the timestamp of the first trackpoint will be used.
   {"video_time", &opt_videotime, "Video position for which exact GPS time is known (hhmmss, default is 0:00:00)", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
   {"gps_time", &opt_gpstime, "GPS time at position video_time (hhmmss, default is first timestamp of track)", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
   {"gps_date", &opt_gpsdate, "GPS date at position video_time (hhmmss, default is first timestamp of track)", nullptr, ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
   {"format", &opt_format, "Format for subtitles", "%s km/h %e m\\n%t %l", ARGTYPE_STRING, ARG_NOMINMAX, nullptr },
-  ARG_TERMINATOR
 };
 
 /* manifest: capabilities of this module, pointers to exported functions and others */
@@ -281,7 +280,7 @@ ff_vecs_t subrip_vecs = {
   nullptr,
   subrip_write,
   nullptr,
-  subrip_args,
+  &subrip_args,
   CET_CHARSET_ASCII, 0
   , NULL_POS_OPS,
   nullptr
index 6f28cddd0fbbe06ac19afe8c9db9cdfdc3008399..37765d3f0af41247b97b277091174ca9113ebc9c 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef SWAPDATA_H_INCLUDED_
 #define SWAPDATA_H_INCLUDED_
 
-#include "defs.h"    // for Waypoint (ptr only), arglist_t, ARG_TERMINATOR
+#include "defs.h"    // for arglist_t, Waypoint
 #include "filter.h"  // for Filter
 
 #if FILTERS_ENABLED
 class SwapDataFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void process() override;
 
 private:
-  arglist_t args[1] = {
-    ARG_TERMINATOR
+  QVector<arglist_t> args = {
   };
 
   void swapdata_cb(const Waypoint* ref);
index 48138001cc7f0f0faad16b70904038ed11b1c4bf..6fa5ab9fd9e0c1eb9eca617114d276e8d22cc73d 100644 (file)
@@ -36,12 +36,11 @@ static route_head* route = nullptr;
 
 static char* routevia = nullptr;
 
-static arglist_t tef_xml_args[] = {
+static QVector<arglist_t> tef_xml_args = {
   {
     "routevia", &routevia, "Include only via stations in route",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 #define MYNAME "TourExchangeFormat"
@@ -328,7 +327,7 @@ ff_vecs_t tef_xml_vecs = {
   tef_xml_read,
   nullptr,
   nullptr,
-  tef_xml_args,
+  &tef_xml_args,
   CET_CHARSET_UTF8, 1
   , NULL_POS_OPS,
   nullptr
index 7c7ef64481f25a261c7cf55f967f81b26e3aa617..2a8f49702d683e78fccfd99481e0e4271c3c7d51 100644 (file)
@@ -26,8 +26,7 @@
 
 
 static
-arglist_t teletype_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> teletype_args = {
 };
 
 /*******************************************************************************
@@ -113,7 +112,7 @@ ff_vecs_t teletype_vecs = {
   teletype_read,
   nullptr,
   teletype_exit,
-  teletype_args,
+  &teletype_args,
   CET_CHARSET_ASCII, 0                 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
diff --git a/text.cc b/text.cc
index dd96fab1afec7430875181f92b5cdc11aaf54834..ed8fc063a868926b8316dcf2d3c60d080f2cb34d 100644 (file)
--- a/text.cc
+++ b/text.cc
@@ -41,7 +41,7 @@ static QString output_name;
 #define MYNAME "TEXT"
 
 static
-arglist_t text_args[] = {
+QVector<arglist_t> text_args = {
   {
     "nosep", &suppresssep,
     "Suppress separator lines between waypoints",
@@ -68,7 +68,6 @@ arglist_t text_args[] = {
     "Write each waypoint in a separate file", nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
 
-  ARG_TERMINATOR
 };
 
 
@@ -272,7 +271,7 @@ ff_vecs_t text_vecs = {
   nullptr,
   data_write,
   nullptr,
-  text_args,
+  &text_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 7e747900b547f19fc09c5182f0dfde1d95e36416..df934a5bef1eb238bb2c9739b1f1326a07e86287 100644 (file)
--- a/tiger.cc
+++ b/tiger.cc
@@ -63,7 +63,7 @@ static char* clickmap = NULL;
 
 
 static
-arglist_t tiger_args[] = {
+QVector<arglist_t> tiger_args = {
   {
     "nolabels", &nolabels, "Suppress labels on generated pins",
     nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -121,7 +121,6 @@ arglist_t tiger_args[] = {
     NULL, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
 #endif
-  ARG_TERMINATOR
 };
 
 
@@ -323,7 +322,7 @@ ff_vecs_t tiger_vecs = {
   data_read,
   data_write,
   nullptr,
-  tiger_args,
+  &tiger_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index c734d7ab411943f279e5cc77e223079da6b5b831..9166dabab1963c6ec5ae95bf08bd4b41a66bd8ac 100644 (file)
--- a/tomtom.cc
+++ b/tomtom.cc
@@ -54,8 +54,7 @@ static gbfile* file_in;
 static gbfile* file_out;
 
 static
-arglist_t tomtom_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> tomtom_args = {
 };
 
 static void
@@ -473,7 +472,7 @@ ff_vecs_t tomtom_vecs = {
   data_read,
   data_write,
   nullptr,
-  tomtom_args,
+  &tomtom_args,
   CET_CHARSET_MS_ANSI, 0       /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
diff --git a/tpg.cc b/tpg.cc
index 463ed83a3a7e23bb9580740cd1d5b3f14ef3ea5f..143b9e940d5e95eb655474a7fd9165127de0ddde 100644 (file)
--- a/tpg.cc
+++ b/tpg.cc
@@ -39,9 +39,8 @@ static int tpg_datum_idx;
 static unsigned int waypt_out_count;
 
 static
-arglist_t tpg_args[] = {
+QVector<arglist_t> tpg_args = {
   {"datum", &tpg_datum_opt, "Datum (default=NAD27)", "N. America 1927 mean", ARGTYPE_STRING, ARG_NOMINMAX , nullptr},
-  ARG_TERMINATOR
 };
 
 static int
@@ -315,7 +314,7 @@ ff_vecs_t tpg_vecs = {
   tpg_read,
   tpg_write,
   nullptr,
-  tpg_args,
+  &tpg_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr};
diff --git a/tpo.cc b/tpo.cc
index dcb8a97562e029f285809e09a6ba449fa9978153..f31d570852644a28c534941bc642ac607cab1ae4 100644 (file)
--- a/tpo.cc
+++ b/tpo.cc
@@ -98,12 +98,11 @@ static char* output_state = nullptr;
 
 #ifdef ENABLE_TPO_WRITE
 static
-arglist_t tpo2_args[] = {
+QVector<arglist_t> tpo2_args = {
        { "dumpheader", &dumpheader, "Display the file header bytes",
                "0", ARGTYPE_BOOL, ARG_NOMINMAX} ,
        { "state", &output_state, "State map format to write, default=CA",
          "CA", ARGTYPE_STRING, ARG_NOMINMAX} ,
-       ARG_TERMINATOR
 };
 #else
 //
@@ -114,14 +113,12 @@ arglist_t tpo2_args[] = {
 // above.
 //
 static
-arglist_t tpo2_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> tpo2_args = {
 };
 #endif
 
 static
-arglist_t tpo3_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> tpo3_args = {
 };
 
 
@@ -1834,7 +1831,7 @@ ff_vecs_t tpo2_vecs = {
   nullptr,
 #endif
   nullptr,
-  tpo2_args,
+  &tpo2_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
@@ -1851,7 +1848,7 @@ ff_vecs_t tpo3_vecs = {
   tpo_read,
   nullptr,
   nullptr,
-  tpo3_args,
+  &tpo3_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 5900485430fede581b65001f298855db2f1361b8..c7c99a39d8f9d3ee354b6b594fa12914df8b6b48 100644 (file)
 int TrackFilter::trackfilter_opt_count()
 {
   int res = 0;
-  arglist_t* a = args;
 
-  while (a->argstring) {
-    if (*a->argval != nullptr) {
+  for (const auto& arg : qAsConst(args)) {
+    if (*arg.argval != nullptr) {
       res++;
     }
-    a++;
   }
   return res;
 }
index d873d74313108859100a5a0246cd70c27029a0b9..d0caadaba7eef7a4ca5a63e89ccd8097319fa359 100644 (file)
@@ -53,9 +53,9 @@
 class TrackFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void init() override;
   void process() override;
@@ -82,7 +82,7 @@ private:
   char* opt_minpoints = nullptr;
   int minimum_points{0};
 
-  arglist_t args[19] = {
+  QVector<arglist_t> args = {
     {
       TRACKFILTER_MOVE_OPTION, &opt_move,
       "Correct trackpoint timestamps by a delta", nullptr, ARGTYPE_STRING,
@@ -169,7 +169,6 @@ private:
       "Discard tracks with fewer than these points",
       nullptr, ARGTYPE_INT, "0", "50", nullptr
     },
-    ARG_TERMINATOR
   };
 
   QList<route_head*> track_list;
index d1e02f9c52fa8d8bba88966a36cf7b893b4d12a7..6577bc3225acb1c0b7b418d2fdda311d8c86e074 100644 (file)
@@ -32,9 +32,9 @@
 class TransformFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void process() override;
 
@@ -50,7 +50,7 @@ private:
 
   const QString RPT = "RPT";
 
-  arglist_t args[7] = {
+  QVector<arglist_t> args = {
     {
       "wpt", &opt_waypts, "Transform track(s) or route(s) into waypoint(s) [R/T]", nullptr,
       ARGTYPE_STRING, ARG_NOMINMAX, nullptr
@@ -75,7 +75,6 @@ private:
       "del", &opt_delete, "Delete source data after transformation", "N",
       ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   void transform_waypoints();
index 48f1aea794d2522b9e904020280fcbb58b8cbfd7..9914e04cf55d3405572e4eeb370ca928a2d3b280 100644 (file)
--- a/unicsv.cc
+++ b/unicsv.cc
@@ -285,7 +285,7 @@ static int unicsv_waypt_ct;
 static char unicsv_detect;
 static int llprec;
 
-static arglist_t unicsv_args[] = {
+static QVector<arglist_t> unicsv_args = {
   {
     "datum", &opt_datum, "GPS datum (def. WGS 84)",
     "WGS 84", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
@@ -318,7 +318,6 @@ static arglist_t unicsv_args[] = {
     "codec", &opt_codec, "codec to use for reading and writing strings (default UTF-8)",
     "UTF-8", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 
@@ -2102,7 +2101,7 @@ ff_vecs_t unicsv_vecs = {
   unicsv_rd,
   unicsv_wr,
   nullptr,
-  unicsv_args,
+  &unicsv_args,
   CET_CHARSET_UTF8, 0
   , NULL_POS_OPS,
   nullptr
index c99302e23b0546f933ca384e4aa4dea94220e0fc..cff72bce6e5e0d50c69e19e50675a060870773b6 100644 (file)
@@ -31,9 +31,9 @@
 class ValidateFilter:public Filter
 {
 public:
-  arglist_t* get_args() override
+  QVector<arglist_t>* get_args() override
   {
-    return args;
+    return &args;
   }
   void process() override;
 
@@ -46,7 +46,7 @@ private:
   unsigned int head_ct;
   unsigned int segment_ct_start;
   const char* segment_type;
-  arglist_t args[3] = {
+  QVector<arglist_t> args = {
     {
       "checkempty", &opt_checkempty, "Check for empty input",
       "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
@@ -55,7 +55,6 @@ private:
       "debug", &opt_debug, "Output debug messages instead of possibly issuing a fatal error",
       "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
     },
-    ARG_TERMINATOR
   };
 
   void validate_head(const route_head*);
diff --git a/vcf.cc b/vcf.cc
index 7290d154ec6c047e80b40d11c9ba53fff8fa6e3e..da94b2c653e536ce449c995bc058d11ea16a4dc8 100644 (file)
--- a/vcf.cc
+++ b/vcf.cc
@@ -32,12 +32,11 @@ static char* vcf_encrypt = nullptr;
 #define MYNAME "VCF"
 
 static
-arglist_t vcf_args[] = {
+QVector<arglist_t> vcf_args = {
   {
     "encrypt", &vcf_encrypt,
     "Encrypt hints using ROT13", nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static void
@@ -142,7 +141,7 @@ ff_vecs_t vcf_vecs = {
   nullptr,
   data_write,
   nullptr,
-  vcf_args,
+  &vcf_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
diff --git a/vecs.cc b/vecs.cc
index fec9c6a9535b1b0f7c467a521970947c9c3e6154..f4730ff988354ecc9afdbc8605b65a26a964c7f0 100644 (file)
--- a/vecs.cc
+++ b/vecs.cc
@@ -1101,15 +1101,33 @@ const QVector<vecs_t> vec_list = {
 #endif // MAXIMAL_ENABLED
 };
 
+/*
+ * When we modify an element on the list we need to be careful
+ * that we are not modifying a Qt COW copy.
+ * Qt has an undocumented but public member function isDetached().
+ * If the list is detached it implies it is not shared, then functions
+ * then might detach, like the iterator begin which is implcitly used
+ * in the range based for loop, won't cause a copy to be created.
+ * We can make sure this is true for at least our regression cases
+ * with assertions.
+ * There is an odd situation that an empty QVector is not detached,
+ * so we have to exclude this from the check.
+ * The possibility of detachement is also why the type of element
+ * on the list must be default constructable. This is why we have
+ * to supply a default for any const members of arglist_t.  Without
+ * the default the default constructor would be implicitly deleted.
+ */
+
 void
 init_vecs()
 {
   for (const auto& vec : vec_list) {
-    if (vec.vec->args) {
-      for (auto arg = vec.vec->args; arg->argstring; arg++) {
-        arg->argvalptr = nullptr;
-        if (arg->argval) {
-          *arg->argval = nullptr;
+    if (vec.vec->args && !vec.vec->args->isEmpty()) {
+      assert(vec.vec->args->isDetached());
+      for (auto& arg : *vec.vec->args) {
+        arg.argvalptr = nullptr;
+        if (arg.argval) {
+          *arg.argval = nullptr;
         }
       }
     }
@@ -1129,11 +1147,12 @@ exit_vecs()
     if (vec.vec->exit) {
       (*vec.vec->exit)();
     }
-    if (vec.vec->args) {
-      for (auto arg = vec.vec->args; arg->argstring; arg++) {
-        if (arg->argvalptr) {
-          xfree(arg->argvalptr);
-          *arg->argval = arg->argvalptr = nullptr;
+    if (vec.vec->args && !vec.vec->args->isEmpty()) {
+      assert(vec.vec->args->isDetached());
+      for (auto& arg : *vec.vec->args) {
+        if (arg.argvalptr) {
+          xfree(arg.argvalptr);
+          *arg.argval = arg.argvalptr = nullptr;
         }
       }
     }
@@ -1229,14 +1248,14 @@ assign_option(const QString& module, arglist_t* arg, const char* val)
 }
 
 void
-disp_vec_options(const QString& vecname, const arglist_t* args)
+disp_vec_options(const QString& vecname, const QVector<arglist_t>* args)
 {
   if (args) {
-    for (auto arg = args; arg->argstring; arg++) {
-      if (*arg->argval && arg->argval) {
+    for (const auto& arg : *args) {
+      if (*arg.argval && arg.argval) {
         printf("options: module/option=value: %s/%s=\"%s\"",
-               qPrintable(vecname), arg->argstring, *arg->argval);
-        if (arg->defaultvalue && (case_ignore_strcmp(arg->defaultvalue, *arg->argval) == 0)) {
+               qPrintable(vecname), arg.argstring, *arg.argval);
+        if (arg.defaultvalue && (case_ignore_strcmp(arg.defaultvalue, *arg.argval) == 0)) {
           printf(" (=default)");
         }
         printf("\n");
@@ -1245,14 +1264,14 @@ disp_vec_options(const QString& vecname, const arglist_t* args)
   }
 }
 
-void validate_options(const QStringList& options, const arglist_t* args, const QString& name)
+void validate_options(const QStringList& options, const QVector<arglist_t>* args, const QString& name)
 {
   for (const auto& option : options) {
     const QString option_name = option.left(option.indexOf('='));
     bool valid = false;
     if (args) {
-      for (auto arg = args; arg->argstring; arg++) {
-        if (option_name.compare(arg->argstring, Qt::CaseInsensitive) == 0) {
+      for (const auto& arg : *args) {
+        if (option_name.compare(arg.argstring, Qt::CaseInsensitive) == 0) {
           valid = true;
           break;
         }
@@ -1280,23 +1299,24 @@ find_vec(const QString& vecname)
 
     validate_options(options, vec.vec->args, vec.name);
 
-    if (vec.vec->args) {
-      for (auto arg = vec.vec->args; arg->argstring; arg++) {
+    if (vec.vec->args && !vec.vec->args->isEmpty()) {
+      assert(vec.vec->args->isDetached());
+      for (auto& arg : *vec.vec->args) {
         if (!options.isEmpty()) {
-          const QString opt = get_option(options, arg->argstring);
+          const QString opt = get_option(options, arg.argstring);
           if (!opt.isNull()) {
-            assign_option(vec.name, arg, CSTR(opt));
+            assign_option(vec.name, &arg, CSTR(opt));
             continue;
           }
         }
-        QString qopt = inifile_readstr(global_opts.inifile, vec.name, arg->argstring);
+        QString qopt = inifile_readstr(global_opts.inifile, vec.name, arg.argstring);
         if (qopt.isNull()) {
-          qopt = inifile_readstr(global_opts.inifile, "Common format settings", arg->argstring);
+          qopt = inifile_readstr(global_opts.inifile, "Common format settings", arg.argstring);
         }
         if (qopt.isNull()) {
-          assign_option(vec.name, arg, arg->defaultvalue);
+          assign_option(vec.name, &arg, arg.defaultvalue);
         } else {
-          assign_option(vec.name, arg, CSTR(qopt));
+          assign_option(vec.name, &arg, CSTR(qopt));
         }
       }
     }
@@ -1322,25 +1342,26 @@ find_vec(const QString& vecname)
       continue;
     }
 
-    validate_options(options, vec_list[0].vec->args, svec.name);
+    validate_options(options, vec_list.at(0).vec->args, svec.name);
 
-    if (vec_list[0].vec->args) {
-      for (auto arg = vec_list[0].vec->args; arg->argstring; arg++) {
+    if (vec_list[0].vec->args && !vec_list[0].vec->args->isEmpty()) {
+      assert(vec_list[0].vec->args->isDetached());
+      for (auto& arg : *vec_list[0].vec->args) {
         if (!options.isEmpty()) {
-          const QString opt = get_option(options, arg->argstring);
+          const QString opt = get_option(options, arg.argstring);
           if (!opt.isNull()) {
-            assign_option(svec.name, arg, CSTR(opt));
+            assign_option(svec.name, &arg, CSTR(opt));
             continue;
           }
         }
-        QString qopt = inifile_readstr(global_opts.inifile, svec.name, arg->argstring);
+        QString qopt = inifile_readstr(global_opts.inifile, svec.name, arg.argstring);
         if (qopt.isNull()) {
-          qopt = inifile_readstr(global_opts.inifile, "Common format settings", arg->argstring);
+          qopt = inifile_readstr(global_opts.inifile, "Common format settings", arg.argstring);
         }
         if (qopt.isNull()) {
-          assign_option(svec.name, arg, arg->defaultvalue);
+          assign_option(svec.name, &arg, arg.defaultvalue);
         } else {
-          assign_option(svec.name, arg, CSTR(qopt));
+          assign_option(svec.name, &arg, CSTR(qopt));
         }
       }
     }
@@ -1414,6 +1435,20 @@ sort_and_unify_vecs()
     svp.append(uvec);
   }
 
+  /* The style formats are based on the xcsv format,
+   * Make sure we know which entry in the vector list that is.
+   */
+  assert(vec_list.at(0).name == "xcsv");
+  /* The style formats use a modified xcsv argument list that doesn't include
+   * the option to set the style file.  Make sure we know which entry in
+   * the argument list that is.
+   */
+  assert(case_ignore_strcmp(vec_list.at(0).vec->args->at(0).helpstring,
+                            "Full path to XCSV style file") == 0);
+  /* Prepare a modified argument list for the style formats. */
+  auto xcsv_args = new QVector<arglist_t>(*vec_list.at(0).vec->args); /* LEAK */
+  xcsv_args->removeFirst();
+
   /* Walk the style list, parse the entries, dummy up a "normal" vec */
   for (const auto& svec : style_list) {
     xcsv_read_internal_style(svec.style_buf);
@@ -1421,15 +1456,15 @@ sort_and_unify_vecs()
     uvec.name = svec.name;
     uvec.vec = new ff_vecs_t; /* LEAK */
     uvec.extensions = xcsv_file.extension;
-    *uvec.vec = *vec_list[0].vec; /* Inherits xcsv opts */
+    *uvec.vec = *vec_list.at(0).vec; /* Inherits xcsv opts */
     /* Reset file type to inherit ff_type from xcsv. */
     uvec.vec->type = xcsv_file.type;
     /* Skip over the first help entry for all but the
      * actual 'xcsv' format - so we don't expose the
-     * 'full path to xcsv style file' argument to any
+     * 'Full path to XCSV style file' argument to any
      * GUIs for an internal format.
      */
-    uvec.vec->args++;
+    uvec.vec->args = xcsv_args;
     memset(&uvec.vec->cap, 0, sizeof(uvec.vec->cap));
     switch (xcsv_file.datatype) {
     case unknown_gpsdata:
@@ -1476,14 +1511,14 @@ disp_vecs()
     }
     printf(VEC_FMT, qPrintable(vec.name), qPrintable(vec.desc));
     if (vec.vec->args) {
-      for (auto arg = vec.vec->args; arg->argstring; arg++) {
-        if (!(arg->argtype & ARGTYPE_HIDDEN))
+      for (const auto& arg : qAsConst(*vec.vec->args)) {
+        if (!(arg.argtype & ARGTYPE_HIDDEN))
           printf("       %-18.18s    %s%-.50s %s\n",
-                 arg->argstring,
-                 (arg->argtype & ARGTYPE_TYPEMASK) ==
+                 arg.argstring,
+                 (arg.argtype & ARGTYPE_TYPEMASK) ==
                  ARGTYPE_BOOL ? "(0/1) " : "",
-                 arg->helpstring,
-                 (arg->argtype & ARGTYPE_REQUIRED) ? "(required)" : "");
+                 arg.helpstring,
+                 (arg.argtype & ARGTYPE_REQUIRED) ? "(required)" : "");
       }
     }
   }
@@ -1500,14 +1535,14 @@ disp_vec(const QString& vecname)
 
     printf(VEC_FMT, qPrintable(vec.name), qPrintable(vec.desc));
     if (vec.vec->args) {
-      for (auto arg = vec.vec->args; arg->argstring; arg++) {
-        if (!(arg->argtype & ARGTYPE_HIDDEN))
+      for (const auto& arg : qAsConst(*vec.vec->args)) {
+        if (!(arg.argtype & ARGTYPE_HIDDEN))
           printf("       %-18.18s    %s%-.50s %s\n",
-                 arg->argstring,
-                 (arg->argtype & ARGTYPE_TYPEMASK) ==
+                 arg.argstring,
+                 (arg.argtype & ARGTYPE_TYPEMASK) ==
                  ARGTYPE_BOOL ? "(0/1) " : "",
-                 arg->helpstring,
-                 (arg->argtype & ARGTYPE_REQUIRED) ? "(required)" : "");
+                 arg.helpstring,
+                 (arg.argtype & ARGTYPE_REQUIRED) ? "(required)" : "");
       }
     }
   }
@@ -1584,18 +1619,18 @@ disp_v3(const vecs_t& vec)
 {
   disp_help_url(vec, nullptr);
   if (vec.vec->args) {
-    for (auto arg = vec.vec->args; arg->argstring; arg++) {
-      if (!(arg->argtype & ARGTYPE_HIDDEN)) {
+    for (const auto& arg : qAsConst(*vec.vec->args)) {
+      if (!(arg.argtype & ARGTYPE_HIDDEN)) {
         printf("option\t%s\t%s\t%s\t%s\t%s\t%s\t%s",
                CSTR(vec.name),
-               arg->argstring,
-               arg->helpstring,
-               name_option(arg->argtype),
-               arg->defaultvalue ? arg->defaultvalue : "",
-               arg->minvalue ? arg->minvalue : "",
-               arg->maxvalue ? arg->maxvalue : "");
+               arg.argstring,
+               arg.helpstring,
+               name_option(arg.argtype),
+               arg.defaultvalue ? arg.defaultvalue : "",
+               arg.minvalue ? arg.minvalue : "",
+               arg.maxvalue ? arg.maxvalue : "");
       }
-      disp_help_url(vec, arg);
+      disp_help_url(vec, &arg);
       printf("\n");
     }
   }
@@ -1644,26 +1679,40 @@ disp_formats(int version)
   }
 }
 
-bool validate_args(const QString& name, const arglist_t* args)
+//#define FIND_ALL_NULLPTR_ARGUMENTS
+//#define FIND_ALL_EMPTY_ARGUMENT_LISTS
+
+bool validate_args(const QString& name, const QVector<arglist_t>* args)
 {
   bool ok = true;
 
+#ifdef FIND_ALL_NULLPTR_ARGUMENTS
+  if (args == nullptr) {
+    Warning() << name << "Is passing nullptr for arguments.";
+  }
+#endif
+
   if (args != nullptr) {
-    for (auto arg = args; arg->argstring; arg++) {
-      if (arg->argtype == ARGTYPE_INT) {
-        if (arg->defaultvalue &&
-            ! is_integer(arg->defaultvalue)) {
-          Warning() << name << "Int option" << arg->argstring << "default value" << arg->defaultvalue << "is not an integer.";
+#ifdef FIND_ALL_EMPTY_ARGUMENT_LISTS
+    if (args->isEmpty()) {
+      Warning() << name << "It isn't necessary to use an empty argument list, you can pass nullptr.";
+    }
+#endif
+    for (const auto& arg : *args) {
+      if (arg.argtype == ARGTYPE_INT) {
+        if (arg.defaultvalue &&
+            ! is_integer(arg.defaultvalue)) {
+          Warning() << name << "Int option" << arg.argstring << "default value" << arg.defaultvalue << "is not an integer.";
           ok = false;
         }
-        if (arg->minvalue &&
-            ! is_integer(arg->minvalue)) {
-          Warning() << name << "Int option" << arg->argstring << "minimum value" << arg->minvalue << "is not an integer.";
+        if (arg.minvalue &&
+            ! is_integer(arg.minvalue)) {
+          Warning() << name << "Int option" << arg.argstring << "minimum value" << arg.minvalue << "is not an integer.";
           ok = false;
         }
-        if (arg->maxvalue &&
-            ! is_integer(arg->maxvalue)) {
-          Warning() << name << "Int option" << arg->argstring << "maximum value" << arg->maxvalue << "is not an integer.";
+        if (arg.maxvalue &&
+            ! is_integer(arg.maxvalue)) {
+          Warning() << name << "Int option" << arg.argstring << "maximum value" << arg.maxvalue << "is not an integer.";
           ok = false;
         }
       }
index 545878575e4c7e1c81253770dae73a0cc9ced6a7..df8aea48410b783d827750fc8fff9ce2646b13c4 100644 (file)
@@ -43,13 +43,12 @@ static char* vidaone_opt_ver;
 static int vidaone_ver;
 
 static
-arglist_t vidaone_args[] = {
+QVector<arglist_t> vidaone_args = {
   {
     VIDAONE_VER, &vidaone_opt_ver,
     "Version of VidaOne file to read or write (1 or 2)",
     "1", ARGTYPE_INT, "1", "2", nullptr
   },
-  ARG_TERMINATOR
 };
 
 static gbfile* fin, *fout;
@@ -146,7 +145,7 @@ ff_vecs_t vidaone_vecs = {
   vidaone_read,
   vidaone_write,
   nullptr,
-  vidaone_args,
+  &vidaone_args,
   CET_CHARSET_UTF8, 1
   , NULL_POS_OPS,
   nullptr
diff --git a/vpl.cc b/vpl.cc
index 5a575745c5295958996ebe26f58848b963eabc41..542d65d86e1b6ba8e6aab9536a2cbcee917ec212 100644 (file)
--- a/vpl.cc
+++ b/vpl.cc
@@ -114,8 +114,7 @@ C - Checksum
 static void vpl_parse_75_sentence(const char*);
 
 static
-arglist_t vpl_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> vpl_args = {
 };
 
 static gbfile* vpl_file_in;
@@ -222,7 +221,7 @@ ff_vecs_t vpl_vecs = {
   vpl_read,
   nullptr,
   nullptr,
-  vpl_args,
+  &vpl_args,
   CET_CHARSET_ASCII, /* ascii is the expected character set */
   1                   /* fixed, can't be changed through command line parameter */
   , NULL_POS_OPS,
index 2d0ee1c3b868d9e0069b5a97d1716e2cf996e675..f8597db575ca53fcce34ea650e0d9d8caacc576a 100644 (file)
@@ -1054,12 +1054,11 @@ static void data_read()
 
 /* wbt */
 
-static arglist_t wbt_sargs[] = {
+static QVector<arglist_t> wbt_sargs = {
   {
     "erase", &erase, "Erase device data after download",
     "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 ff_vecs_t wbt_svecs = {
@@ -1072,7 +1071,7 @@ ff_vecs_t wbt_svecs = {
   data_read,
   nullptr,
   nullptr,
-  wbt_sargs,
+  &wbt_sargs,
   CET_CHARSET_UTF8, 1         /* master process: don't convert anything | CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
@@ -1080,8 +1079,7 @@ ff_vecs_t wbt_svecs = {
 
 /* used for wbt-bin /and/ wbt-tk1 */
 
-static arglist_t wbt_fargs[] = {
-  ARG_TERMINATOR
+static QVector<arglist_t> wbt_fargs = {
 };
 
 ff_vecs_t wbt_fvecs = {
@@ -1094,7 +1092,7 @@ ff_vecs_t wbt_fvecs = {
   file_read,
   nullptr,
   nullptr,
-  wbt_fargs,
+  &wbt_fargs,
   CET_CHARSET_UTF8, 1         /* master process: don't convert anything | CET-REVIEW */
   , NULL_POS_OPS,
   nullptr
index 9093af9b09671f8cc8197200eec07b9dfe6ea00d..6708623d02ce3e0c93af2202ff12f821b038a238 100644 (file)
@@ -30,7 +30,7 @@ static char*  ahoicon =nullptr;
 static char*   snmac   =nullptr;
 
 static
-arglist_t wfff_xml_args[] = {
+QVector<arglist_t> wfff_xml_args = {
   {
     "aicicon", &aicicon, "Infrastructure closed icon name",
     "Red Square", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
@@ -48,7 +48,6 @@ arglist_t wfff_xml_args[] = {
     "Green Diamond", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
   {"snmac", &snmac, "Shortname is MAC address", nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr },
-  ARG_TERMINATOR
 };
 
 #define xfreez(p) { if (p) xfree(p); p=0; }
@@ -234,7 +233,7 @@ ff_vecs_t wfff_xml_vecs = {
   wfff_xml_read,
   nullptr,
   nullptr,
-  wfff_xml_args,
+  &wfff_xml_args,
   CET_CHARSET_UTF8, 0,
   NULL_POS_OPS,
   nullptr
index 9d8736acf721b81024faafd9dff3ea54ab0e52f9..1373af9435506f718bf6bedf4a18b4e791c2786e 100644 (file)
@@ -93,8 +93,7 @@ wintec_tes_read()
 }
 
 static
-arglist_t wintec_tes_args[] = {
-  ARG_TERMINATOR
+QVector<arglist_t> wintec_tes_args = {
 };
 
 ff_vecs_t wintec_tes_vecs = {
@@ -111,7 +110,7 @@ ff_vecs_t wintec_tes_vecs = {
   wintec_tes_read,
   nullptr,
   nullptr,
-  wintec_tes_args,
+  &wintec_tes_args,
   CET_CHARSET_ASCII, 0                 /* ascii is the expected character set */
   /* not fixed, can be changed through command line parameter */
   , NULL_POS_OPS,
diff --git a/xcsv.cc b/xcsv.cc
index d7e012299da3edf6259178f9d01dc1cc42c9c5a2..ed93d05482a45dfdde341edfce2a75091d32812c 100644 (file)
--- a/xcsv.cc
+++ b/xcsv.cc
@@ -213,7 +213,7 @@ static char* opt_datum;
 static const char* intstylebuf = nullptr;
 
 static
-arglist_t xcsv_args[] = {
+QVector<arglist_t> xcsv_args = {
   {
     "style", &styleopt, "Full path to XCSV style file", nullptr,
     ARGTYPE_FILE | ARGTYPE_REQUIRED, ARG_NOMINMAX, nullptr
@@ -247,7 +247,6 @@ arglist_t xcsv_args[] = {
     "datum", &opt_datum, "GPS datum (def. WGS 84)",
     "WGS 84", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 /* something to map config file constants to chars */
@@ -2234,7 +2233,7 @@ ff_vecs_t xcsv_vecs = {
   xcsv_data_read,
   xcsv_data_write,
   nullptr,
-  xcsv_args,
+  &xcsv_args,
   CET_CHARSET_ASCII, 0,        /* CET-REVIEW */
   { nullptr, nullptr, nullptr, xcsv_wr_position_init, xcsv_wr_position, xcsv_wr_position_deinit },
   nullptr
diff --git a/xol.cc b/xol.cc
index 12fe7ee7f50a9805fe7e1eeac5d4321810528f29..7ec4a219c5903a7816cb378b4286fcd9cdb60916 100644 (file)
--- a/xol.cc
+++ b/xol.cc
@@ -38,7 +38,7 @@ static short_handle short_h;
 static gpsbabel::File* oqfile;
 static gpsbabel::XmlStreamWriter* writer;
 
-static arglist_t xol_args[] = {ARG_TERMINATOR};
+static QVector<arglist_t> xol_args = {};
 
 #define MYNAME "xol"
 
@@ -306,7 +306,7 @@ ff_vecs_t xol_vecs = {ff_type_file,
                       xol_read,
                       xol_write,
                       nullptr,
-                      xol_args,
+                      &xol_args,
                       CET_CHARSET_UTF8,
                       0  , NULL_POS_OPS,
   nullptr
index 3e9bbf350feeed4b8e50844ca5b1b9de5cb769b0..33401370b82b725eab59ea2cc7f0659014f04236 100644 (file)
--- a/yahoo.cc
+++ b/yahoo.cc
@@ -29,13 +29,12 @@ static char* as;
 #define MYNAME "yahoo"
 
 static
-arglist_t yahoo_args[] = {
+QVector<arglist_t> yahoo_args = {
   {
     "addrsep", &as,
     "String to separate concatenated address fields (default=\", \")",
     ", ", ARGTYPE_STRING, ARG_NOMINMAX, nullptr
   },
-  ARG_TERMINATOR
 };
 
 static xg_callback     wpt_s, wpt_lat, wpt_lon, wpt_e;
@@ -111,7 +110,7 @@ ff_vecs_t yahoo_vecs = {
   yahoo_read,
   nullptr,
   nullptr,
-  yahoo_args,
+  &yahoo_args,
   CET_CHARSET_ASCII, 0 /* CET-REVIEW */
   , NULL_POS_OPS,
   nullptr